原文:https://blog.csdn.net/weixin_44860135/article/details/97761411
splice我觉得很方便
数组.splice(开始下标,删除个数);
var a=[1,2,3,4,5];
a.splice(0,1);
console.log(a);
//返回结果 [2, 3, 4, 5]
var a=[1,2,3,4,5];
a.splice(1,2);
console.log(a);
//返回结果 [1, 4, 5]
2024-03-14 14:23:34
原文:https://blog.csdn.net/weixin_44860135/article/details/97761411
splice我觉得很方便
数组.splice(开始下标,删除个数);
var a=[1,2,3,4,5];
a.splice(0,1);
console.log(a);
//返回结果 [2, 3, 4, 5]
var a=[1,2,3,4,5];
a.splice(1,2);
console.log(a);
//返回结果 [1, 4, 5]