I’m super not embarrassed to admit that I just learned:
ES6 arrow functions do not have their own `this`. They inherit `this` for free without having to do `.bind` or `self = this`. 
-
-
Replying to @zachleat
The same thing goes for `arguments`, `super`, and `http://new.target `
Those, and `this`, are not special-cased or anything — it’s just that arrow functions don’t create a new function scope.2 replies 2 retweets 14 likes -
uhhh... arrow functions definitely create a scope. they don't, however, have their own execution context (aka `this`).
3 replies 0 retweets 3 likes -
Would I be right in saying they create no more scope than { // scoped expression } ?
1 reply 0 retweets 0 likes -
No, e.g. `var` is not block-scoped and would be hoisted outside of the block in that case. It would not be hoisted outside a function or arrow function.
1 reply 0 retweets 0 likes -
Huh, okay. But `let` would be scoped in there?
1 reply 0 retweets 1 like
Yes
-
-
Thanks!
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.