3 ms·
I kinda like the way JS evolved into a modern language, where essentially ~everyone uses a linter that e.g. prevents the use of `var`. Sure, it's technically st
by Vinnl 8mo ago
I kinda like the way JS evolved into a modern language, where essentially ~everyone uses a linter that e.g. prevents the use of `var`. Sure, it's technically still in the language, but it's almost never used anymore.
(Assuming transpilers have stopped outputting it, which I'm not confident about.)
- thunderfork 8mo agoDepending on the transpiler and mode of operation, `var` is sometimes emitted. For example, esbuild will emit var when targeting ESM, for performance and minification reasons. Because ESM has its own inherent scope barrier, this is fine, but it won't apply the same optimizations when targeting (e.g.) IIFE, because it's not fine in that context. https://github.com/evanw/esbuild/issues/1301 https://github.com/evanw/esbuild/issues/1301
- delaminator 8mo agofor some values of "everyone" and "never".
- yawaramin 8mo agoActually... https://github.com/microsoft/TypeScript/issues/52924 https://github.com/microsoft/TypeScript/issues/52924
- Vinnl 8mo agoAh yeah, I remember that. General point still stands: in terms of the lived experience of developers, `var` is essentially deprecated.
- plorkyeran 8mo agoI touch JS that uses var heavily on a daily basis and I would be incredibly surprised to find out that I am alone in that.
- Vinnl 8mo agoThat is indeed why I added qualifiers to "everyone" and "never".