It seems like the following will be a common pattern
function f(x = undefined) {}
to document that the param is optional.
It desugars to:
function f() {
var x = arguments[0] !== (void 0) ? arguments[0]: undefined;
}
We could do a little bit better and do:
function f() {
var x = arguments[0];
}
Original issue reported on code.google.com by arv@chromium.org on 8 Feb 2013 at 10:40
Original issue reported on code.google.com by
arv@chromium.org
on 8 Feb 2013 at 10:40