Learning JavaScript Using Console

Daily post #7 – I missed writing a post yesterday so I’m going to write two posts today. This one is about using your Google Chrome console to learn JavaScript. Let’s dive into this directly!

First open your Google Chrome console by going to menu bar > view > developer > JavaScript console. Or you can use CMD+OPT+J (because I like keyboard shortcuts).

Once in Console, you can type in any JS code and it’ll execute right there and give you the result at the same time. For example, type in the following code:

[code lang=”javascript”]
a = 5
b = 6

This will print the values of a and b on screen. You can also write multiline code using shift+enter or just by copy pasting code in there. For example:

[code lang=”javascript”]
for (i=0; i<10; i++)

This will print out numbers from 0 to 9. The best part about this process is you can do this inside your browser while watching a tutorial on YouTube!

That’s all in this post. Going to write another post now! 🙂