3 ms·
I disagree. Maybe you think this because you are used to another language, but once you get how var works, it's quite clear. Just because some other language do
by protonfish 11y ago
I disagree. Maybe you think this because you are used to another language, but once you get how var works, it's quite clear. Just because some other language does it, does not mean it is unquestionably good.
- serve_yay 11y agoOn the contrary, I pretty much only write JS and have for years now. And I think `var` has warped our brains, not the other way around.
- tangent128 11y agoIf Javascript didn't have closures, then var's scoping rules would largely be academic. But in practice, there are many cases when I have to create multiple callbacks in a loop; half the time I forget that, in Javascript, declaring a variable inside a loop does not actually create a variable local to the loop, and so have to keep debugging why all my callbacks are behaving exactly the same. The let statement appears to adopt Lua-style lexical scoping, which will be a breath of fresh air once I can rely on browser support.