If that's what they are for, why call them "arrow functions", and not lambdas like everybody else does?
Re:ES6 is beautiful
by TheCoelacanth on Thursday April 07, 2016 @04:47PM
(#11450580)
To distinguish from javascript's other longer way of writing the same thing:
[1, 2, 3, 4].map(function (x) { return x + 1; })
Re:ES6 is beautiful
by rhinoceraptor on Thursday April 07, 2016 @04:31PM
(#11450456)
Javascript already had lambdas/anonymous functions since the beginning.
[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.