r/AskCodecoachExperts • u/CodewithCodecoach • May 18 '25
🔖 Web Development Series ✅ 🧠 Web Dev Series #5 – Variables, Data Types & Console Like a Pro
Hey future developers! 👋 Welcome back to our Beginner-to-Advanced Web Development Series — built so anyone can learn, even if today is your first day of coding.
You’ve already:
✅ Understood what JavaScript is
✅ Seen how it can make your website interactive
Now, let’s unlock the real power of JS — starting with the building blocks of logic: variables & data types!
🧱 What Are Variables?
Variables are like containers or labeled boxes where you store data.
let name = "Tuhina";
let age = 22;Here’s what’s happening:
letis a keyword (it tells JS you're making a variable)nameandageare the variable names"Tuhina"and22are the values stored
🔄 Now you can use name or age anywhere in your program!
🧠 Real-Life Analogy:
Imagine a classroom:
let studentName = "Ravi"is like writing Ravi’s name on a name tagThe tag = variable
The name written = value
You can change the name on the tag anytime, and JS will update it for you!
🔤 JavaScript Data Types
Here are the basic types you’ll use all the time:
| Type | Example | Description |
|---|---|---|
| String | "hello" | Text inside quotes |
| Number | 10, 3.14 | Numbers (no quotes) |
| Boolean | true, false | Yes or No (used in decisions) |
| Null | null | Empty on purpose |
| Undefined | undefined | Not yet given a value |
🖥️ Logging with console.log()
This is like talking to your code. Use it to check what’s happening.
let city = "Delhi";
console.log(city);✅ Open your browser
✅ Right-click → Inspect → Go to Console tab
✅ You’ll see "Delhi" printed!
It’s your personal debugging assistant!
🧩 Mini Task: Try This!
Paste this in your browser console or JS playground:
let favColor = "blue";
let luckyNumber = 7;
let isCool = true;
console.log("My favorite color is " + favColor);
console.log("Lucky number: " + luckyNumber);
console.log("Am I cool? " + isCool);✅ Change the values
✅ See how your output changes!
🚫 Common Mistakes Beginners Make
❌ Forgetting quotes around strings ✅ "hello" not hello
❌ Using a variable without declaring it ✅ Use let, const, or var to declare
❌ Typing Console.log() ✅ It's lowercase → console.log()
📚 Learn More (Free Resources)
💬 Need Help?
Still not sure when to use quotes or how to log multiple values? Drop your code here — we’ll help you debug it!
🧭 What’s Next?
Next up: Operators in JavaScript – Math, Comparisons & Logic!
🔖 Bookmark this post & follow the flair: Web Development Series
👋 Say “Logged In ✅” in the comments if you’re following along!