splice
Array.prototype.splice() - JavaScript | MDN
memo
code:js
const array = "a", "b", "c"
const aa = []
aa.splice(0, ...array)
aa
//=> 'b', 'c'
const bb = []
bb.splice(0, 'a', 'b', 'c')
bb
//=> 'b', 'c'
const cc = []
cc.splice(0, 0, ...array)
cc
//=> 'a', 'b', 'c'
# push が簡単
const xx = []
xx.push(...array)
//=> 'a', 'b', 'c'
code:js
// 第3引数があるときは第2引数を省略できない
splice(start)
splice(start, deleteCount)
splice(start, deleteCount, item1)
splice(start, deleteCount, item1, item2, itemN)