Traceur supports the former (6to5 doesn't).  I think both of those should
be valid, the former just because it makes sense (likely why it accidently
works in traceur), and the latter because it's very useful.

http://jsbin.com/bevijekiki/1/edit

These should be equivalent (minus the o variable)

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



On Fri, Nov 28, 2014 at 8:45 AM, Bradley Meck <bradley.m...@gmail.com>
wrote:

> I might be missing something but it appears in es6 you cannot default a
> destructured argument?
>
> ```
> function foo({d}={d:1}) {
>
> }
> ```
>
> and
>
> ```
> function foo({d=1}) {
>
> }
> ```
>
> don't seem to fall into the syntax, are there plans for this in the future
> or something that prevented this?
>
> _______________________________________________
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to