upvote
reply
Ah yeah, I remember that. General point still stands: in terms of the lived experience of developers, `var` is essentially deprecated.
reply
I 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.
reply
for some values of "everyone" and "never".
reply
Depending 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

reply