Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 0.3 — Your Tools: Browser, Editor and DevTools
HTML · Example 1 of 2

Messages in the console

Each console call prints one line. Warnings and errors are coloured, like in DevTools.

All you need is a browser and a text editor; the browser's DevTools let you inspect any page, see errors and try changes live.

Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.

Ready for more? This phase has 3 hands-on exercises with automatic checks.

Practice questions

Write the code in the editor, run it, then open the model answer to compare.

01

In the console example, print the result of 10 * 12 with a label, so the console shows 10 * 12 = 120.

02

Add a line that prints how many characters are in your name, using "YourName".length.

Explain it without notes

01

What are the Elements, Console and Network panels of DevTools for?

02

Why do changes you make in DevTools disappear when you reload?

Messages in the console

Preview

Press Run to see the page.

Console

Nothing logged yet.

Expected console output

Hello from JavaScript!
2 + 3 = 5
This is a warning
This is an error message