3 ms·
> In fact 'const' and 'let' are often worse than 'var' because of the temporal dead zone. Seems like a massive overstatement. What are you even referring to as
by hombre_fatal 7y ago
> In fact 'const' and 'let' are often worse than 'var' because of the temporal dead zone.
Seems like a massive overstatement. What are you even referring to as the downside?
For 99% of usecases/people, TDZ just means you get a runtime error for your use-before-declaration bugs.
The only reason I can see for using `var` is if you're doing some very confident performance hacking in a hot loop and you have the performance testing harness to prove that you're not just wasting your time.