2 ms·
I don't like the function level scoping, but I could probably get over it. Hoisting variable definitions is just straight up pants on head stupid. The way sco
by TheCoelacanth 9y ago
I don't like the function level scoping, but I could probably get over it.
Hoisting variable definitions is just straight up pants on head stupid.
The way scoping for `this` works is bizarre and un-intuitive. I routinely run into people who spend a lot of time programming in JS and who I consider pretty smart and capable programmers (based on reviewing dozens/hundreds of PRs from them) who didn't understand the way it works until after I explained it to them.
let/const/arrow functions fix most of these, but it took over twenty years for those problems to get fixed. Also, they didn't exist when this article was written in 2013.