let myArray2 = [1, 2, 3, 4, 5]; // 删除索引 4 位置起,2 个元素 myArray2.splice(4, 2); console.log(myArray2); //--> [1, 2, 3,4],你写成了[1,2,3]