Oliver Hunt (2013-07-26T15:58:44.000Z)
domenic at domenicdenicola.com (2013-07-26T16:25:21.855Z)
On Jul 26, 2013, at 8:50 AM, Domenic Denicola <domenic at domenicdenicola.com> wrote: > Why do arrow functions require a parameter list and a body? That is, none of the following are allowed: > > - `=> foo` I guess this could be lexically unambiguous, but i'm unconvinced that the "win" of losing two characters in the strictly less common no parameters is worth the syntactic confusion > - `bar =>` > - `=>` I think an optional tail would be a huge coding hazard - a typo could result in bizarre behaviour, take: ```js blah(=>,5) ``` vs ```js blah(=>5) ``` > > Instead you need the more-verbose > > - `() => foo` Honestly I'm not sold on the {} free production, but i understand the arguments for it. Randomly (and because i'm too lazy to check) how would ```js a => b => c ``` produce? I mean aside from making the maintainers cry.