4 ms·
Let/const behave more the way you'd expect in JavaScript. They came about as part of the language shift in 2015, along with a lot of other conveniences. Many of
by schwartzworld 5y ago
Let/const behave more the way you'd expect in JavaScript. They came about as part of the language shift in 2015, along with a lot of other conveniences. Many of JS's warts are less of an issue if you write modern code.
I guess there's nothing technically wrong using var, but there's no reason to use it over let in almost any setting, and a tutorial that starts you with var might be outdated.