4 ms·
This, and the short function syntax (that's also already in Firefox stable: "let square = x => x * x") make me very giddy. It's always been possible to write Ja
by mrspeaker 13y ago
This, and the short function syntax (that's also already in Firefox stable: "let square = x => x * x") make me very giddy. It's always been possible to write JavaScript in a functional style - but this kind of sugar makes it much much nicer. Things like Traceur will even let us transpile to old-school JS for old browser support, so for a lot of projects we can start using these things real soon.
- mnemonik 13y agoCombine the two: const tail = [, ...xs] => xs;
- Fistandantilus 13y agoIs Javascript's const head-const or tail-const?
- Benvie 13y agoconst tail = ([, ...xs]) => xs;
- mnemonik 13y agoAh you can't do the single-param-drop-parens when combined with destructuring? Good to know, thanks Benvie.