Lesson 1 of 4
Hello, Console
In JavaScript, console.log() prints a message. It's the first tool every JavaScript developer reaches for:
Press Run to see the output. Statements usually end with a semicolon ;.
Comments
// starts a comment that lasts until the end of the line. /* ... */ can span several lines:
console.log() takes several values too, separated by commas:
console.log('Second', 'breakfast'); // prints: Second breakfast
Exercise: Greet the Shire
Write a program that prints exactly:
Hello, Shire!
Your turn!
Write your code in and press Submit answer.
- program → Hello, Shire!