2 ms·
I don't think it's fair to blame something like this on Javascript per se, but that doesn't mean it isn't fundamentally badly designed ;) However, people actual
by to3m 11y ago
I don't think it's fair to blame something like this on Javascript per se, but that doesn't mean it isn't fundamentally badly designed ;) However, people actually appear to have started to notice this, and the latest result, ECMAScript 6, looks actually like it might be OK. At last, when people tell you JS isn't that bad, you can actually believe them - though if they told you that before, maybe do your own research too.
With the latest version, you have block scope, you have a shorthand function syntax, the "this" nonsense is teeny bit less awful, there's help at hand for the inevitable callback chains, and strict mode is still there. There's also a new class syntax (though actually - aside from "this"! - I thought the old-style classes were the least of its problems).
I won't apologise for rolling my eyes a bit at how it's taken until ver 6 to get block scope, but better late than never.