解構拆解 語法: ... 三個點為收回剩下值 方法一 : slice() // 1.單獨刪減組裝用法 // 語法 slice() (切片) // slice(0,3) 切分陣列 (含頭不含尾)!! // 所以是切分順序從第 0 個到第 2 個 !! const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9]; const index = 3; // 要去除 index=3 ,第四個數字(陣列第一個數字順序為0) console.log([...arr.slice(0, i...
Markdown supported · ⌘↵ to post
No responses yet.