Pseudo headless arrows
Peter van der Zee
ecma at qfox.nl
Thu Apr 21 18:48:18 UTC 2016
<searched for it><excuses if>
There are two ways of writing argument-less arrows;
() => x;
_ => x;
(Where `_` can be any identifier, of course.) I understand why we
can't drop the head entirely so if we're forced to type anything at
all, anyways, why not at least make it simpler by pressing two
different keys instead of three/four:
I don't believe this leads to syntactical problems anywhere, not even
with arrow functions themselves and it's future proof for at least the
cases I'm aware of.
It's a minor addition but I think it's much nicer than either of the
two alternatives we currently have, which lead to a lot of
inconsistencies (it's spaces and tabs all over again).
Semantics are the same otherwise as `() => x` would be.
More information about the es-discuss