Refutable destructuring

Brandon Benvie bbenvie at mozilla.com
Fri Aug 9 15:40:05 PDT 2013


On 8/9/2013 3:36 PM, Axel Rauschmayer wrote:
>     let { +a: foo, b: bar } = { a: 1 };  // foo = 1, b = undefined
>     let { +a: foo, b: bar } = { };  // exception
>
>     function bla(+mandatoryArg, optionalArg1, optionalArg2 = 123) {
>         ...
>     }

I presume these would also be valid, and do the expected:

```js
function foo({ +bar }){ }
function foo2([+bar2]){ }
```

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130809/00189081/attachment.html>


More information about the es-discuss mailing list