Hello, World

The smallest Node.js program, and how console.log() prints.

Runs in Zerethon IDE · Node.js 22 Official JavaScript documentation ↗

A script runs from top to bottom with Node.js — there is no browser, so there is no document or window; output goes to the Output tab.

main.js
console.log('Hello, World!');
console.log('Sum:', 2 + 3);
console.log(`Template: ${10 * 2}`);
console.error('This line goes to stderr');

Output

Hello, World!
Sum: 5
Template: 20
  • console.log() separates its arguments with a space; console.error() writes to the error stream (shown in the Output tab too).
  • Semicolons are optional but recommended; comments are // … or /* … */.