Home › Learn › JavaScript › Getting started

Hello, world

Lesson 1 of 40. Print with console.log and see how lessons are checked.

JavaScript runs your code from the top line down. console.log() writes whatever you put between the parentheses to the output. Text goes in quotes; single and double quotes both work as long as they match. Statements usually end with a semicolon; JavaScript will forgive a missing one, but the habit avoids surprises.

Each console.log produces one line. The checks read the lines your code printed and compare them with what the task asks for, character for character.

console.log("Good morning");
console.log('Second line');

Your task

Print exactly two lines: Hello, world! and then JavaScript is running in my browser.

Hint 1

One console.log per line, with the text in quotes.

Hint 2

Check the punctuation: a comma after Hello, an exclamation mark, a full stop at the end of the second sentence.

Show the solution
console.log("Hello, world!");
console.log("JavaScript is running in my browser.");

    Runs in an isolated web worker in this tab; nothing is sent anywhere.