domenic at domenicdenicola.com (2014-02-18T04:25:10.150Z)
> ```js
> my_list.map(<val>{return val<0?-val:val;});//return absolut-ified array content
> ```
Are you aware of the existing arrow functions? Using current ES6,
your example would be written as:
```js
my_list.map(val=>val<0?-val:val);
```domenic at domenicdenicola.com (2014-02-18T04:24:27.595Z)
Are you aware of the existing arrow functions? Using current ES6, your example would be written as: ```js my_list.map(val=>val<0?-val:val); ```
On Tue, Feb 11, 2014 at 12:33 PM, biscotte a la crevette <biscottealacrevette at gmail.com> wrote: > I would like to suggest an alternative function declaration syntax rule : > http://pastebin.mozilla.org/4258633 > > That will lead to a way shorter function declaration (like Array [...] > and Object {...} does ) : > > long story short : <...> will be equivalent to function(...) > > Which mean : > > var print = <name,age>{ //eq. to var print = function(name,age){... > console.log("my name is " + name + " " + age + "y old.\n"); > } > > Human = <name,age=0>{ > this.age=age; > this.name=age; > this.toString=<>{ > return ... > }; > } > > And so, will work with anonymous function declaration (which was my main goal). > > my_list.map(<val>{return val<0?-val:val;});//return absolut-ified array content Are you aware of the existing arrow functions? Using current ES6, your example would be written as: my_list.map(val=>val<0?-val:val); ~TJ