JavaScript Learning Journey: Day 5 - Data Types

Starting my JavaScript learning journey — sharing what I learn every day. 🚀 📅 JavaScript Learning Journey — Day 5 Today I learned about Data Types in JavaScript — one of the core concepts every developer must understand. Data types define what kind of value a variable holds. 🔎 Main Data Types in JavaScript 🔹 Primitive Data Types • String → Text let name = "Redoan"; • Number → Numeric value let age = 20; • Boolean → true / false let isStudent = true; • Undefined → value not assigned let x; • Null → intentionally empty let y = null; --- 🔸 Non-Primitive Data Type • Object → collection of data let user = { name: "Redoan", age: 20 }; --- 🧠 Check Data Type using "typeof" console.log(typeof "Hello"); // string console.log(typeof 100); // number console.log(typeof true); // boolean ⚠️ Interesting Fact 😲 console.log(typeof null); // object (this is a known bug in JavaScript) --- 📌 Key Takeaways (Day 5) • Data types define the type of value • Primitive vs Non-Primitive • "typeof" is useful to check types • JavaScript is dynamically typed This is Day 5 of my JavaScript learning series. Next, I’ll explore Operators in JavaScript. #JavaScript #WebDevelopment #FrontendDeveloper #LearningInPublic #100DaysOfCode #programinghero

  • graphical user interface, application

To view or add a comment, sign in

Explore content categories