var arr = [1, 2, 3, 4, 5];
var removeItem = 2;
arr = $.grep(arr, function(value) {
return value != removeItem;
});
翻译自: https://css-tricks.com/snippets/jquery/remove-specific-value-from-array/
var arr = [1, 2, 3, 4, 5];
var removeItem = 2;
arr = $.grep(arr, function(value) {
return value != removeItem;
});
翻译自: https://css-tricks.com/snippets/jquery/remove-specific-value-from-array/