Re:JavaScript for People Who Hate JavaScript
by cutler on Wednesday August 09, 2017 @03:16PM
(#14972617)
Add to this the WTF ES6 added to the lanuage like different "this" scoping for arrow functions. Great. Now I have 2 headaches instead of 1.
[ Parent
| on HN ]
Re:JavaScript for People Who Hate JavaScript
by devdad on Wednesday August 09, 2017 @04:27PM
(#14973260)
I'd say you have one. If you had one before, you didn't know what really happened when you went `var that = this;` and aired your opinion about how `this` is being stupid. So you got the arrow function, where `this` acts the way you expected before, when you said it was stupid. You can't complain about both.
The scoping of `this` has never really been too hard to understand. I learned it my first week doing JS.