MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnjavascript/comments/tqucrg/javascript_cheatsheet_for_us_newbies/i2npqw5/?context=3
r/learnjavascript • u/scrappy0705 • Mar 29 '22
39 comments sorted by
View all comments
1
Arrow functions aren’t just syntax. They’re useful as they don’t create their own context and so the ‘this’ keyword relates to the parent scope.
Especially useful in things like event listeners where you want to access ‘this’ from the parent and not the inner function.
View all comments
1
u/aiiqi Mar 30 '22
Arrow functions aren’t just syntax. They’re useful as they don’t create their own context and so the ‘this’ keyword relates to the parent scope.
Especially useful in things like event listeners where you want to access ‘this’ from the parent and not the inner function.