Code coverage report for array/removeAll.js

Statements: 100% (8 / 8)      Branches: 100% (0 / 0)      Functions: 100% (3 / 3)      Lines: 100% (7 / 7)     

All files » array/ » removeAll.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161         1 2 2 6 6       1    
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;
});