Lesson 1 of 15

Hello, World!

Your First JavaScript Program

JavaScript's built-in function for printing output is console.log():

console.log("Hello, World!");

This prints the string to the console, followed by a newline. You can log any value — strings, numbers, booleans:

console.log("hello");   // hello
console.log(42);        // 42
console.log(true);      // true

Comments

Single-line comments start with //. Everything after // on the same line is ignored:

// This is a comment
console.log("code");  // This is also a comment

Multi-line comments use /* ... */:

/* This spans
   multiple lines */
console.log("done");

Your Task

Print exactly Hello, World! using console.log.

JavaScript loading...
Loading...
Click "Run" to execute your code.