4 ms·
When you say "don't use [var]" do you mean only in ES6, or even before ES6? If before ES6, then if you could explain your reasoning more I'd be interested to h
by dsjoerg 11y ago
When you say "don't use [var]" do you mean only in ES6, or even before ES6?
If before ES6, then if you could explain your reasoning more I'd be interested to hear it. I use var regularly, but would be happy to be re-educated.
- orangeshark 11y agoThere is no alternative to var before ES6, so of course your only option is to use it. If you use any of the various compilers that introduce let and const, it is recommended to use them over var. These compilers basically just check, at compile time, those variables satisfy the correct behaviors of let and const and just converts them to var for ES5 and below.