UNPKG
@arnaudnyc/mout
Version:
latest (1.2.4)
1.2.4
1.2.3
1.2.2-secfix
Modular Utilities
moutjs.com
arnaudnyc/mout
@arnaudnyc/mout
/
src
/
array
/
removeAll.js
16 lines
(13 loc)
•
329 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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; });