function copy(arr1, arr2) { for (var i =0; i< arr1.length; i++) { arr2[i] = arr1[i]; } } copy(arr1, arr2)