I have two arrays:
var arrayA = [ 0, 0, 0 ];
var arrayB = new Uint8Array( 2 );
arrayB[0] = 1;
arrayB[1] = 2;
I would like to copy the values from arrayB to a particular index in arrayA.
For example:
arrayB.copyTo( arrayA, 1 );
arrayA would now become:
[0, 1, 2, 0, 0];
Is there a way of doing this in vanilla javascript without using an iterator?