Your code's voice
Most of what a program does happens invisibly. The console is how you ask it, "what are you doing right now?" Programmers use it every single day — even after 20 years of experience.
console.log, piece by piece
console.log("Good morning");- console — the place where messages appear.
- .log — the action: write a line there.
- ( ) — brackets hold what you're giving to the action.
- ; — the end of the instruction.
console.log can show numbers too — and numbers don't need quotes:
console.log(2026);
console.log(7 + 3);
console.log("7 + 3");You can show several things at once by separating them with commas. They appear on one line with spaces between.
console.log("Momo:", 12, "pieces");