Default values of destructured arguments?

Kevin Smith zenparsing at gmail.com
Fri Nov 28 08:15:56 PST 2014


>
> function({d=1}){}
> function(o){ var d = o instanceof Object && o.d !== undefined ? o.d : 1 }
>

Not exactly - see my previous post.  You've supplied a default
destructuring value, but not a default *parameter* value.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20141128/b10dd013/attachment.html>


More information about the es-discuss mailing list