i need to copy one array into another.
doing something like:
myArr1 = myArr2;
will just pass the reference, not copying the data, and further
changes to myArr2 will be reflected in myArr1 - not want i need.
iterating through the whole array and copying value by value works,
but seems a little long winded (maybe it isn't?)
myArr1[i] = myArr2[i];
was looking around for something like "Array.copy()" - but no luck.
came up with:
myArr1 = myArr2.slice(0);
to actually copy the data, and it works.
just wanted to know what others are doing in this situation and if
there is a preferred method.