domenic at domenicdenicola.com (2014-02-18T04:25:32.898Z)
Also, there are short method declarations:
```js
var obj = {
foo(bar, baz) {
// stuffs
}
}
```Also, there are short method declarations:
```js
var obj = {
foo(bar, baz) {
// stuffs
}
}
```
On Wed, Feb 12, 2014 at 9:39 AM, Tab Atkins Jr. <jackalmage at gmail.com>wrote: > 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); > Also, there are short method declarations: var obj = { foo(bar, baz) { // stuffs } } -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140212/a5df7d63/attachment.html>