1 | var indexOf = require('./indexOf');
|
2 |
|
3 | /**
|
4 | * Remove all instances of an item from array.
|
5 | */
|
6 | function removeAll(arr, item){
|
7 | var idx = indexOf(arr, item);
|
8 | while (idx !== -1) {
|
9 | arr.splice(idx, 1);
|
10 | idx = indexOf(arr, item, idx);
|
11 | }
|
12 | }
|
13 |
|
14 | module.exports = removeAll;
|
15 |
|