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.
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.