Skip to main content

Lesson 6 - Hello World!

  • Open Chrome, go into Developer Tools > Console and type
let js = "awesome";
if (js === "awesome") alert("Hello World! JavaScript is awesome.");

The browser should popup a box which says Hello World! JavaScript is awesome.

This works because we set js to equal awesome if it didn't then the popup would not display.

We can also do math

40 + 10 + 25 - 6;

Chrome DevTools Console showing a mathematical expression 40 + 10 + 25 - 6 resulting in 69