Thank you guys, I somehow missed that vital piece of information...
Right after I sent the proposal I read Brendans blog post from October and
found the info regarding returning arrays. Sorry for the noise. :)
I'll read the specs more thoroughly and get back if I have any more concerns.
Anyhow
See here: http://wiki.ecmascript.org/doku.php?id=harmony:destructuring and
https://developer.mozilla.org/en-US/docs/JavaScript/New_in_JavaScript/1.7#Destructuring_assignment_%28Merge_into_own_page.2Fsection%29
Anton
On 3 January 2013 07:26, anders elo and...@kaerus.com wrote:
I'd like to
Anton Kovalyov wrote:
anders elo wrote:
I'd like to propose the incorporation of multiple return values into
the ES standard.
function foo(){
return 1,2,3;
}
let (a,b,c) = foo();
let (a,b) = foo(); // ignore c
let (a,...b) = foo() // a = 1, b = [2,3]
/* also useful for
Brendan Eich wrote:
function pair(x, y) { return [x, h]; }
s/h/y/ there of course!
let [x, y] = pair(3,4);
And Nathan beat me to it -- sorry for not updating mail before replying...
/be
___
es-discuss mailing list
es-discuss@mozilla.org
4 matches
Mail list logo