UNPKG

304 BJavaScriptView Raw
1var indexOf = require('./indexOf');
2
3 /**
4 * Remove a single item from the array.
5 * (it won't remove duplicates, just a single item)
6 */
7 function remove(arr, item){
8 var idx = indexOf(arr, item);
9 if (idx !== -1) arr.splice(idx, 1);
10 }
11
12 module.exports = remove;
13