Default values of destructured arguments?
Kevin Smith
zenparsing at gmail.com
Fri Nov 28 08:26:07 PST 2014
Try this:
http://google.github.io/traceur-compiler/demo/repl.html#(function(%7Bd%3D1%7D)%7B%20return%20d%20%7D()%20%3D%3D%3D%201)%0A
Maybe an old version or traceur on jsbin?
On Fri, Nov 28, 2014 at 11:17 AM, Frankie Bagnardi <f.bagnardi at gmail.com>
wrote:
> 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/9533774e/attachment.html>
More information about the es-discuss
mailing list