$ node
> A = [0, 1, 23]
[ 0, 1, 23 ]
> B = A
[ 0, 1, 23 ]
> A.splice(0, 3)
[ 0, 1, 23 ]
> B
[]
> A
[]
> A = A.concat([1, 2])
[ 1, 2 ]
> B
[]
This is correct. But, is it possible that after calling concat
, B
array be equal with A
?
I know that there is the loop solution, but what other alternatives are there to add multiple elements in multiple arrays that are equal?
BTW, I don't want to modify B
directly (A = B = A.concat(...)
).