Code coverage report for array/invoke.js

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

All files » array/ » invoke.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171           1 3 3 6   3     1    
define(['./forEach'], function (forEach) {
 
    /**
     * Call `methodName` on each item of the array passing custom arguments if
     * needed.
     */
    function invoke(arr, methodName, var_args){
        var args = Array.prototype.slice.call(arguments, 2);
        forEach(arr, function(item){
            item[methodName].apply(item, args);
        });
        return arr;
    }
 
    return invoke;
});