Closed saschanaz closed 6 years ago
You can do some things with arrow functions which you can't using this syntax.
while
you can put it into an arrow function.??
, ???
, etc.) will be probably removed. See #4.And this syntax' general use case is to partially apply an expression (generally function, operator or method), so that name wouldn't be really intuitive.
(...) => expression
not (...) => { statement }
but I think it's okay.Well, actually, a function is essentially a chunk of code what has some parts which are variable (arguments). So we could call them as partial code syntax. That doesn't sound good at all. In this case, the chunk of code must be an expression => its a partial expression. So I think its perfectly valid. If we want to stay valid & we want to mention that this is a shorthand, we must call it something like "Arrow Function For Expression Shorthand Syntax (where we can't use arguments from outer functions using this syntax)" which is not a very nice name. I would rather stay with the current one.
Note that the Arrow function syntax is also called Arrow function syntax rather than Function shorthand syntax :).
Closing due to inactivity.
I think a name e.g. 'Arrow Function Shorthand Syntax' would be better because this proposal essentially is to introduce a shorthand syntax for arrow functions.