Skip to content
~/mahadi hassan
← All posts

Tag

Javascript

Why var Prints 4 4 4 but let Prints 1 2 3 in JavaScript
Javascript

Why var Prints 4 4 4 but let Prints 1 2 3 in JavaScript

Ever wondered why replacing `var` with `let` changes the output of a simple loop? Learn how JavaScript scope, closures, and the event loop work together, with real-world examples and interview insights.

4 min read