{0: c, 1: d} = {0: a, 1: b, length: 2}
> results in a const 'c' and const 'd' created with the vlaues of a and b.
>
> shouldn't it have created a variable '0' and '1' ?
>
>>
>> On Wed, Mar 20, 2019 at 12:59 AM Sultan wrote:
&
results in a const 'c' and const 'd' created with the vlaues of a and b.
shouldn't it have created a variable '0' and '1' ?
>
> On Wed, Mar 20, 2019 at 12:59 AM Sultan wrote:
>
>> Afford array destructuring to Array-like ob
If gather the expected result correctly object destructuring can be used
const {0: a, 1: b} = {0: a, 1: b, length: 2}
On Wed, Mar 20, 2019 at 12:59 AM Sultan wrote:
> Afford array destructuring to Array-like objects.
>
> const [a, b] = {0: a, 1: b,
,
> length: 2,
> *[Symbol.iterator]() {
> let i = 0;
> while (i < this.length) {
> yield this[i]
> i++
> }
> },
> };
>
>
>
> On Mar 20 2019, at 11:59 am, Sultan wrote:
>
> Affor
wrote:
> Afford array destructuring to Array-like objects.
>
> const [a, b] = {0: a, 1: b, length: 2}
>
> ___
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
Why is that any different or better than
const [a, b] = [a, b]
?
On Tue, Mar 19, 2019 at 7:59 PM Sultan wrote:
> Afford array destructuring to Array-like objects.
>
> const [a, b] = {0: a, 1: b, length: 2}
>
>
> ___
> es-disc
Afford array destructuring to Array-like objects.
const [a, b] = {0: a, 1: b, length: 2}
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
7 matches
Mail list logo