splice 插入元素

splice(index, count_to_remove, addelement1, addelement2, ...) 加入 和/或 移除陣列的元素,在適當的位置修改

var a = ['a', 'b', 'c', 'd', 'e'];

var removed = a.splice(1, 3, 'f', 'g', 'h', 'i');

print(removed); // b,c,d

print(a); // a,f,g,h,i,e