📜  splice 删除索引前的 0 个元素并插入新元素 - Javascript 代码示例

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

代码示例1
let myFish = ['angel', 'clown', 'mandarin', 'sturgeon']
let removed = myFish.splice(2, 0, 'drum')

// myFish is ["angel", "clown", "drum", "mandarin", "sturgeon"]
// removed is [], no elements removed