數組方法

數組方法 1. 修改器方法 copyWithin()ES6 在數組內部, 將一段元素序列拷貝到另外一段元素序列上, 覆蓋原有的值web var a = [1, 2, 3, 4, 5] a.copyWithin(0, 3) console.log(a) // [4, 5, 3, 4, 5] // 能夠接受三個參數 Array.copyWithin(target[, start][, end]) //
相關文章
相關標籤/搜索