Code coverage report for function/curry.js

Statements: 100% (9 / 9)      Branches: 100% (2 / 2)      Functions: 100% (5 / 5)      Lines: 100% (8 / 8)     

All files » function/ » curry.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201   1 5           1 2 2 3       1      
define(function () {
 
    function slice(arr, offset){
        return Array.prototype.slice.call(arr, offset || 0);
    }
 
    /**
     * Creates a partially applied function.
     */
    function curry(fn, var_args){
        var argsArr = slice(arguments, 1); //curried args
        return function(){
            return fn.apply(this, argsArr.concat(slice(arguments)));
        };
    }
 
    return curry;
 
});