How to Open Google Chrome's JavaScript Console
See JavaScript: Tips and Tricks for similar articles.You can use Google Chrome's Console to practice JavaScript.
- Click on the three-vertical-dot icon in the upper right of Google Chrome.
- Select More Tools.
- Select Developer Tools.
- The tools will usually be docked on the right or bottom of your screen. Make sure that the Console is selected:
You may need to drop down the menu to see the Console option:
- Now type "gobbledygook" in the Console and press Enter:
The word "gobbledygook" doesn't mean anything in JavaScript and we have not defined a variable named "gobbledygook", so we get an error.
- To clear the Console, press the Clear Console icon:
- You should now have a clear Console to start practicing JavaScript:
- Test it by ype
var age = 18;
and press Enter:Don't worry about the "undefined" response. All that means is that your code didn't return anything.
- Now type
age;
and press Enter:This time it does return something - the value of
age
. - You can also access the existing document. To demonstrate, type
document.body.style.backgroundColor='red';
and press Enter. The background color should change to red.
Play around with the console. Have fun!
Related Articles
- Node.js and Node Package Manager (npm)
- How to Install Node.js on a Mac
- How to Run a Node.js Application on Windows
- How to Send and Receive JSON Data to and from the Server
- How to Run a Node.js Application on a Mac
- How to Open Google Chrome's JavaScript Console (this article)
- How to Create a Google Map Object with the Maps JavaScript API
- Why JavaScript is called JavaScript
- How to Learn JavaScript on Your Own
- How to Install Node.js on Windows