Re: Destructuring for Array-like objects

2019-03-22 Thread guest271314
{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: &

Re: Destructuring for Array-like objects

2019-03-22 Thread J Decker
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

Re: Destructuring for Array-like objects

2019-03-22 Thread guest271314
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,

Re: Destructuring for Array-like objects

2019-03-19 Thread Jordan Harband
, > 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

Re: Destructuring for Array-like objects

2019-03-19 Thread Frederick Stark
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 >

Re: Destructuring for Array-like objects

2019-03-19 Thread Ranando King
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

Destructuring for Array-like objects

2019-03-19 Thread Sultan
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