Can you elaborate on these situations?

In general, I find that using specific array indexes is most often a code
smell.

On Mon, Dec 4, 2017 at 11:21 AM, /#!/JoePea <[email protected]> wrote:

> 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
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to