remove.js 302 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 define(['./indexOf'], function(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); } return remove; });