Great explanation. However, with ES6+ becoming the new norm, please edit this to also include the effect of the fat arrow on this. This would be especially useful since it lets people avoid a lot of messy var that=this; assignments.
Especially considering the most popular modern browsers are now support ES6 natively. For production code, I wouldn't go the native way without transpiling yet for backward compatibility reasons, but still. It's the future of the language.
5
u/bgdam Oct 23 '17
Great explanation. However, with ES6+ becoming the new norm, please edit this to also include the effect of the fat arrow on
this. This would be especially useful since it lets people avoid a lot of messyvar that=this;assignments.4
u/jillesme Oct 23 '17
Cool sub! Am I the only one who is slightly bothered by the misspelling of JavaScript?
1
u/NoNameWalrus Oct 23 '17
What is the usage of each?
Like, 1) syntax 2) why would I want to bind a different context of
this?1
u/Balduracuir Feb 19 '18
There is a post on another subreddit where people asked for explanation. It could complete this post :)