Default values of destructured arguments?

Frankie Bagnardi f.bagnardi at gmail.com
Fri Nov 28 08:17:24 PST 2014


Odd, traceur seems to be fine with function({d=1}){ return d }() === 1

http://jsbin.com/birajevaxi/2/edit

On Fri, Nov 28, 2014 at 9:15 AM, Kevin Smith <zenparsing at gmail.com> wrote:

> 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/bd0020aa/attachment-0001.html>


More information about the es-discuss mailing list