For example:
> var aryA = [];
undefined
> var aryB = [1, 2, 3];
undefined
> aryB.forEach(aryA.push.bind(aryA));
undefined
> aryA
[1, 0, Array[3], 2, 1, Array[3], 3, 2, Array[3]]
Yes, I want to copy the elements from aryB
to aryA
. Of course I have other solutions, but why doesn't this method work?
Please forgive if this is a duplicate question. I am a Stackoverflow newcomer.