A modern, ES6+ first guide to declaring variables in JavaScript — when to use const, when to use let, why var still exists, and how scope, hoisting, and the temporal dead zone actually work.
How JavaScript went from a 10-day prototype in 1995 to the modern, standardised ECMAScript language powering the web, Node.js, and edge runtimes in 2024.
Disclosure: Some links on this page may contain affiliate links. If you make a purchase through these links, we may earn a small commission at no extra cost to you. See our Affiliate Disclosure for details.