To create a copy of an array that is independent of another array:
Use the Array object’s slice() method.
For example, the following statements create an array and then use slice() to make an independent copy of the array.
var oldArray = ["1", "b", "3"];
var newArray = oldArray.slice();