Y
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
geoelectric
3109 days ago
Given that "this" isn't referenced in the function, though, it's practically equivalent.
link
simlevesque
3109 days ago
I think one is more efficient memory wise but I'm not sure which one.
link
mmanfrin
3109 days ago
The non-fat-arrow one, as it does not need to carry around the context of `this` with it.
link
hoosieree
3108 days ago
Do you have a reference for this? I always thought arrows were
lighter
weight because their `this` is static rather than dynamic.
link