let arr1 = [1,2,3,4,5]; let arr2 = [...arr1]; arr2[0] = -2; console.log(arr2);// outputs : [-2,2,3,4,5] console.log(arr1);// outputs : [1,2,3,4,5]