Learning JavaScript: Variables, Data Types, and Type Checking

Today, I continued my journey into the world of JavaScript (JS) and explored some core building blocks — Variables, Data Types, and Type Checking! 🔍✨ Here’s what I practiced and learned today 👇 🧮 🔹 Data Summary Exercise 📘 I created a small program to store and display a student’s information. let studentName = "Rahul";       // String let totalMarks = 75;             // Number let isPassed = totalMarks > 40;  // Boolean console.log("Student Name: " + studentName); console.log("Total Marks: " + totalMarks); console.log("Passed: " + isPassed); 🧾 Output: Student Name: Rahul Total Marks: 75 Passed: true 💡 This helped me understand data types like string, number, and boolean — and how conditions can define logic inside our code. 🧩 🔹 Quiz — Guess the Datatype! These tricky examples tested my understanding of JavaScript’s behavior with the typeof operator 👇 console.log(typeof null); console.log(typeof NaN); console.log(typeof [1,2,3]); console.log(typeof {a:1}); console.log(typeof (() => {})); 🧠 Answers: 1."object" 2."number"“Not a Number” but still of type number 😅 3. "object" 4."object" 5."function" Arrow function type 🎯 Key Takeaway (Day 2): “In JavaScript, things aren’t always what they seem — understanding data types is the first step to writing clean and bug-free code.” 💡 Tomorrow, I’ll be diving into Functions, Operators, and Conditional Logic — can’t wait to make things more interactive! ⚡ Special thanks to: 10000 Coders Harish M #Day2 #JavaScript #LearningJourney #WebDevelopment #Frontend #Coding #100DaysOfCode #TechJourney #FullStack #Programming #Variables #DataTypes #JS #CodeNewbie

  • text

To view or add a comment, sign in

Explore content categories