3 ms·
That's part of the spec, they're really meant for doing functional style, one liner type of things, like [1, 2, 3, 4].map(x => x + 1) You should probably avoi
by rhinoceraptor 11y ago
That's part of the spec, they're really meant for doing functional style, one liner type of things, like
[1, 2, 3, 4].map(x => x + 1)
You should probably avoid using them for other applications, particularly if you're using a library that uses prototypes because it won't work.
- douche 11y agoIf that's what they are for, why call them "arrow functions", and not lambdas like everybody else does?
- rhinoceraptor 11y agoJavascript already had lambdas/anonymous functions since the beginning.
- TheCoelacanth 11y agoTo distinguish from javascript's other longer way of writing the same thing: [1, 2, 3, 4].map(function (x) { return x + 1; })