lib/base/functions.js
function applyFirst(method, args) {
    args = Array.prototype.slice.call(arguments).slice(1);
    if (!isString(method) && !isFunction(method)) {
        throw new Error(method + " must be the name of a property or function to execute");
    }
    if (isString(method)) {
        return function () {
            var scopeArgs = Array.prototype.slice.call(arguments), scope = scopeArgs.shift();
            var func = scope[method];
            if (isFunction(func)) {
                scopeArgs = args.concat(scopeArgs);
                return spreadArgs(func, scopeArgs, scope);
            } else {
                return func;
            }
        };
    } else {
        return function () {
            var scopeArgs = Array.prototype.slice.call(arguments), scope = scopeArgs.shift();
            scopeArgs = args.concat(scopeArgs);
            return spreadArgs(method, scopeArgs, scope);
        };
    }
}
function applyFirst(method, args) {
    args = Array.prototype.slice.call(arguments).slice(1);
    if (!isString(method) && !isFunction(method)) {
        throw new Error(method + " must be the name of a property or function to execute");
    }
    if (isString(method)) {
        return function () {
            var scopeArgs = Array.prototype.slice.call(arguments), scope = scopeArgs.shift();
            var func = scope[method];
            if (isFunction(func)) {
                scopeArgs = args.concat(scopeArgs);
                return spreadArgs(func, scopeArgs, scope);
            } else {
                return func;
            }
        };
    } else {
        return function () {
            var scopeArgs = Array.prototype.slice.call(arguments), scope = scopeArgs.shift();
            scopeArgs = args.concat(scopeArgs);
            return spreadArgs(method, scopeArgs, scope);
        };
    }
}
function applyFirst ( method , args ) { args = Array . prototype . slice . call ( arguments ) . slice ( 1 ) ; if ( ! isString ( method ) && ! isFunction ( method ) ) { throw new Error ( method + " must be the name of a property or function to execute" ) ; } if ( isString ( method ) ) { return function ( ) { var scopeArgs = Array . prototype . slice . call ( arguments ) , scope = scopeArgs . shift ( ) ; var func = scope [ method ] ; if ( isFunction ( func ) ) { scopeArgs = args . concat ( scopeArgs ) ; return spreadArgs ( func , scopeArgs , scope ) ; } else { return func ; } } ; } else { return function ( ) { var scopeArgs = Array . prototype . slice . call ( arguments ) , scope = scopeArgs . shift ( ) ; scopeArgs = args . concat ( scopeArgs ) ; return spreadArgs ( method , scopeArgs , scope ) ; } ; } }
Binds a method to the scope of the first argument.

This is useful if you have async actions and you just want to run a method or retrieve a property on the object.

```
var arr = [], push = comb.applyFirst("push"), length = comb.applyFirst("length");
push(arr, 1, 2,3,4);
console.log(length(arr)); //4
console.log(arr); //1,2,3,4

```
@static
@memberOf comb
@param {String|Function} method the method to invoke in the scope of the first arument.
@param [args] optional args to pass to the callback

@returns {Function} a function that will execute the method in the scope of the first argument.
Binds a method to the scope of the first argument .