Re:Debugging Node.js in Production
by Killswitch on Friday December 04, 2015 @04:18PM
(#10679201)
That defeats the whole purpose of fat arrow functions.
I'm not sure what purpose you have in mind.
The main purposes of fat arrow functions is the auto-binding of this and succinctness.
A named fat-arrow function would still retain both, and in fact the feature was considered for ES6 back in 2013, but didn't made it. Syntax would have been like:
if(objects.find(functionName(object) => object.id === id)) {}
You can have lambdas that are also named, e.g:
if(objects.find(function idCheck(object){ return object.id === id})
Not sure if it's possible with the new ES6 syntax [Edit: apparently it's not, although arrow functions will automatically be assigned a name in some common scenarios].