How to do it...

  1. Create an hello.html file with a some text content:
<html> <meta charset="UTF-8" />  <head>  </head>  <body>  Open Your Console!  </body></html>
  1. Open hello.html by opening your browser, and entering the following URL:  http://localhost:8000/hello.html.
  1. You should see Open Your Console! displayed by the browser:
  1. Lets do what the page tells us and open up the Developer Console. For both Firefox and Chrome, the command is the same:
    • On Windows and Linux:
Ctrl + Shift + I 
  • On macOS:
Cmd + Shift + I  
  1. Next, in the same directory, create a file called hello.js, which exports a function named sayHi that writes a message to ...

Get ECMAScript Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.