Computer >> Computer tutorials >  >> Programming >> Javascript

How to call a JavaScript Function from Chrome Console?


To call a JavaScript function from the console, run the following code:

Example

<!DOCTYPE html>
<html>
   <body>
      <script>
         var display = {
            displayOne: function(){ return "displayTwo" ;}
         };
         console.log(display.displayOne());
      </script>
   </body>
</html>