Hacker News new | ask | show | jobs
by TheDong 3109 days ago
It is not the same as that. the fat arrow doesn't change the value of "this" while the function definition does.
1 comments

Given that "this" isn't referenced in the function, though, it's practically equivalent.
I think one is more efficient memory wise but I'm not sure which one.
The non-fat-arrow one, as it does not need to carry around the context of `this` with it.
Do you have a reference for this? I always thought arrows were lighter weight because their `this` is static rather than dynamic.