If I want to call a function like this:
moo({ a: 4 });
Normally I'd have to phrase my function definition like this:
function moo(myArgObj) {
print(myArgObj.a);
}
But this awesome syntax is totally valid in spidermonkey for defining functions:
function moo({ a, b, c }) { // valid syntax!
print(a); // prints 4
}
What is this feature?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…