Come from Lua, this isn't too confusing. However, it baffles me why they thought it was a good idea to change the this paradigm between arrow and normal function declaration. I've noticed even React will warn about the differences in docs.
@tilkin Agree with you that the whole part isn't that confusing until you come across the arrow functions. It's just completely different from the typhttps://assets.grammarly.com/emoji/v1/1f642.svgical this keyword's pattern. But because of its lexical scoping, arrow functions are perfect to use for callback functions inside higher-order functions to inherit its parent scope. But at the same time, would've been easier to just utilize the explicit binding haha!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Come from Lua, this isn't too confusing. However, it baffles me why they thought it was a good idea to change the this paradigm between arrow and normal function declaration. I've noticed even React will warn about the differences in docs.
@tilkin Agree with you that the whole part isn't that confusing until you come across the arrow functions. It's just completely different from the typhttps://assets.grammarly.com/emoji/v1/1f642.svgical
this
keyword's pattern. But because of its lexical scoping, arrow functions are perfect to use for callback functions inside higher-order functions to inherit its parent scope. But at the same time, would've been easier to just utilize the explicit binding haha!