JavaScript Fundamentals: Understanding undefined, ==, ===, Scope, Hoisting & Closures

🚀 Day 2/100 – #100DaysOfCode Today I focused on understanding how JavaScript actually works under the hood: 🔹 undefined vs null Difference in meaning + why null == undefined is true but null === undefined is false. 🔹 == vs === Loose equality does type coercion. Strict equality checks both value and type. Rule: Default to ===. 🔹 Scope & Lexical Scope Global, function, and block scope (let/const). Lexical scope explains how inner functions access outer variables. 🔹 Hoisting & TDZ JS runs in creation + execution phases. var is hoisted and initialized as undefined. let/const are hoisted but live in the Temporal Dead Zone until initialized. 🔹 Closures Functions remember their outer scope even after execution. This is how private variables and state work. 🔹 Callbacks Functions passed as arguments and executed later — foundation of async JS. The deeper I go, the more JavaScript starts making logical sense. #JavaScript #WebDev #IntermediateJS #CodingChallenge #Frontend #SoftwareEngineering #MERNStack #LearningEveryday

To view or add a comment, sign in

Explore content categories