Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 1.01 KB

File metadata and controls

21 lines (14 loc) · 1.01 KB

Open a new window in Chrome,

then locate the Console tab.

Voila! You now have access to the Chrome V8 Engine. Just like the Node REPL, you can input JavaScript code into the Console tab and the V8 engine will execute it.

Let's try an example.

In the Chrome console, invoke the function alert with an input string of "Hello world!";

What effect does calling the alert function have? It shows a message on the middle top of the page with a sting "Hello world!"

Now try invoking the function prompt with a string input of "What is your name?" - store the return value of your call to prompt in an variable called myName.

What effect does calling the prompt function have? It shows a pop up box message with the sting "What is your name?" as an input in the middle top of the page What is the return value of prompt? it returns the text the user enters or an empty string if enter nothing in case cancel would return null