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!";
A dialog box with message display on top of the page
What effect does calling the alert function have?
A dialog box with ok button displays with message when user click on ok button the dialog box disappears
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.
its works properly I use console.log(nyName); it displays my name that is entered on prompt dialog box
What effect does calling the prompt function have?
A dialog box is opened on the top of the page with a textbox and to buttons ok and cancel
What is the return value of prompt?
if user click on ok prompt return a string and if user click on cancel it returns null