JS快速删除数组中制定元素

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/inforstack/article/details/82222025
var ary = ['123','234','345'];
var idx = ary.indexOf('234'); 
var end = ary.splice(idx, 1); 

console.log(end);
console.log(ary);

猜你喜欢

转载自blog.csdn.net/inforstack/article/details/82222025