r/learnjavascript • • May 09 '20

Javascript Tutorial - Arrow Functions

https://www.youtube.com/watch?v=aYcH26h_HlI&t=26s
126 Upvotes

8 comments sorted by

View all comments

12

u/Content_Performer May 09 '20

TL:DR functions but 'this' actually works

3

u/gotta-lot May 10 '20

I really don’t like when it’s described this way. In JavaScript, ‘this’ has a clear set of rules. It just behaves differently with arrow functions. They serve a very different purpose. Given the way we write JavaScript in 2020, maybe we favor the way it behaves with arrow functions, but I still think it’s unfair to say ‘this’ in function expressions and declarations is something that is broken.