Multi-index assignment.

/#!/JoePea joe at trusktr.io
Mon Dec 4 19:21:01 UTC 2017


I always run into situations where I'd like to assign some things from
another array.

For example,

```js
array[0] = 1
array[1] = 2
```

could be written as

```js
array[0, 1] = [1, 2]
```

and maybe perhaps also specific access on the right hand side too:

```js
array[1] = otherArray[3]
array[4] = otherArray[5]
// can be
array[
​1​
,
​4​
] = [
​
otherArray[3]
​
,
​
otherArray[
​5​
]
​
]
​// but also a shorter form:

array[1, 4] = otherArray[3, 5]
```

*/#!/*JoePea
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20171204/f4546531/attachment.html>


More information about the es-discuss mailing list