//数组 var b=[1,2,3,4]; b.splice(b.indexOf(2,1)) //1,3,4 //jsonvar arrayId=[{"id":233,"name":"英语"},{"id":122,"name":"语文"},{"id":10,"name":"数学"}]for(var i=0;i
arrayId.splice(i,1) } } //{"id":233,"name":"英语"},{"id":10,"name":"数学"}
本文共 286 字,大约阅读时间需要 1 分钟。
//数组 var b=[1,2,3,4]; b.splice(b.indexOf(2,1)) //1,3,4 //jsonvar arrayId=[{"id":233,"name":"英语"},{"id":122,"name":"语文"},{"id":10,"name":"数学"}]for(var i=0;i
arrayId.splice(i,1) } } //{"id":233,"name":"英语"},{"id":10,"name":"数学"}
转载于:https://www.cnblogs.com/weiyf/p/10628054.html