Multiple-value returns JavaScript

by Mohan 2012-09-20 23:31:35



Multiple-value returns
JavaScript 1.7
function f() {

return [1, 2];
}

var [a, b] = f();

Print( a + ' ' + b ); // prints: 1 2


774
like
0
dislike
0
mail
flag

You must LOGIN to add comments