James McGrath

Quick tips, in-depth guides, and thoughts on the future of the web

What Is console.log()?

🧪 Concept:

console.log() is a way to print messages to the console — kind of like writing sticky notes to yourself while coding. It shows you what’s happening inside your program.

let name = "Jamie";
console.log(name); // Jamie

This will print Jamie to the browser’s console — a space where developers can debug and check what their code is doing.

🧰 Why It Matters:

console.log() is one of your most useful tools as a beginner. It helps you see what’s going on: the value of variables, whether something ran, or what a function returned.

🎉 Quick Challenge:

Try logging three things:

console.log("Hello world!");
console.log(5 + 7);
console.log(true);

Watch what shows up in your browser’s console. You’re talking directly to your code.

🧠 Fun Analogy:

console.log() is like yelling into a walkie-talkie to hear if anyone’s listening. It’s your way of asking, “Did this work?”

📚 Further Reading:

MDN Docs – console.log()
W3Schools – console.log().

Subscribe to my feed to follow along. I’ll keep the lessons short and sweet.

What Is a Boolean?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.