编辑代码

let arr = [1,2,3,4,5,6];
let newArr = arr.slice(1,5);
console.log(newArr);// 左开右闭
console.log(arr);