Packages
A web application in pursuit of meaning in life.
Retired package: Complete rewrite, scratch old versions
Current section
Files
Jump to
Current section
Files
assets/node_modules/mout/src/array/removeAll.js
define(['./indexOf'], function(indexOf){
/**
* Remove all instances of an item from array.
*/
function removeAll(arr, item){
var idx = indexOf(arr, item);
while (idx !== -1) {
arr.splice(idx, 1);
idx = indexOf(arr, item, idx);
}
}
return removeAll;
});