javascript – 删除项目[i]从jQuery每个循环

如何在项目到达后从项目中删除项目[i]:

$.each(items, function(i) {
    // how to remove this from items
});
如果你想从数组中删除一个元素,使用splice()

var myArray =['a','b','c','d'];
var indexToRemove = 1;
// first argument below is the index to remove at, 
//second argument is num of elements to remove
myArray.splice(indexToRemove , 1);

myArray现在将包含[‘a’,’c’,’d’]

http://stackoverflow.com/questions/4869292/remove-itemi-from-jquery-each-loop

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:javascript – 删除项目[i]从jQuery每个循环