← Back to Roadmap

Syntax, Hello World, Console.log

Easy

In plain terms

JavaScript syntax uses semicolons (optional), curly braces for blocks, and console.log() to output values. Your first program prints "Hello, World!" to the browser or Node.js console.

What you need to know

  • Statements end with semicolons (often optional)
  • console.log() outputs to the console
  • Case-sensitive language

Try it yourself

Copy the code below and run it in your browser console or a code editor:

// Hello World
console.log('Hello, World!');

// Print multiple values
const name = 'Student';
console.log('Hello,', name);

// Debug with console
console.log(2 + 2); // 4

Learn more

Dive deeper with these trusted resources: