📜  JavaScript 数组 slice() 示例 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:35.094000             🧑  作者: Mango

代码示例1
let numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
let newArray = numbers.slice(4,8);
console.log("The sliced arrays is:", newArray)

// Output: The sliced arrays is: [ 5, 6, 7, 8 ]