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.
After newArray is created, editing either oldArray or newArray has no effect on the other.
Save you time and effort to make an independant copy.