Code coverage report for array/remove.js

Statements: 100% (7 / 7)      Branches: 100% (2 / 2)      Functions: 100% (3 / 3)      Lines: 100% (5 / 5)     

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