Lesson 3 / 38
The Console
Your window into what code is doing.
console.log
The most-used debugging tool — print any value to the DevTools console.
console.log("Hello, JS!");
console.log(1 + 2);
Output:
Hello, JS! 3
Other console methods
console.error(), console.warn(), and console.table() format output differently — useful for spotting issues fast.
DevTools shortcut
Open DevTools with F12 or Ctrl+Shift+I (Cmd+Option+I on Mac) — the Console tab doubles as a live JS REPL.