Now, let's check whether JavaScript works on your machine.
From the tools, select Console. If you cannot find Console, click on the >> symbol, as follows:
Once your console is open, type the following code and hit Enter on your keyboard:
document.write("Hello World");
If you can see the output on the left-hand side panel as shown in the following, then you have successfully configured JavaScript on your browser:
The output that you will see is as follows:
Hello World
Congratulations!
Downloading the example code
You can download the example code files for all the Packt books that you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register in order to have the files e-mailed to you directly.
If you cannot see the text, check your code or install Google Chrome with administrative rights.
You can also click on the gear button of your console. Check whether Disable JavaScript is unchecked:
You can also debug your JavaScript codes using this tool.
If you type anything wrong; consider that you forgot the inverted commas of the Hello World
string, you will get the following errors:
To speed up writing your codes, you may learn some keyboard shortcuts for both console and Atom text editor.
Here are few keyboard shortcuts for console:
Here are few keyboard shortcuts for Atom text editor:
18.119.235.79