Default values of destructured arguments?
Frankie Bagnardi
f.bagnardi at gmail.com
Fri Nov 28 08:32:23 PST 2014
Ah yep, it appears so.
On Fri, Nov 28, 2014 at 9:26 AM, Kevin Smith <zenparsing at gmail.com> wrote:
> 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/2024075f/attachment.html>
More information about the es-discuss
mailing list