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