src/aria/utils/Function.js
function (fn, context) {
            var args = [];
            for (var i = 2; i < arguments.length; i++) {
                args.push(arguments[i]);
            }
            return function () {
                // need to make a copy each time
                var finalArgs = args.slice(0);
                // concat won't work, as arguments is a special array
                for (var i = 0; i < arguments.length; i++) {
                    finalArgs.push(arguments[i]);
                }
                return fn.apply(context, finalArgs);
            };
        }
function (fn, context) {
            var args = [];
            for (var i = 2; i < arguments.length; i++) {
                args.push(arguments[i]);
            }
            return function () {
                // need to make a copy each time
                var finalArgs = args.slice(0);
                // concat won't work, as arguments is a special array
                for (var i = 0; i < arguments.length; i++) {
                    finalArgs.push(arguments[i]);
                }
                return fn.apply(context, finalArgs);
            };
        }
function ( fn , context ) { var args = [ ] ; for ( var i = 2 ; i < arguments . length ; i ++ ) { args . push ( arguments [ i ] ) ; } return function ( ) { // need to make a copy each time var finalArgs = args . slice ( 0 ) ; // concat won't work, as arguments is a special array for ( var i = 0 ; i < arguments . length ; i ++ ) { finalArgs . push ( arguments [ i ] ) ; } return fn . apply ( context , finalArgs ) ; } ; }
Bind a function to a particular context. As a consequence, in the function 'this' will correspond to the
context. Additional arguments will be prepend to the arguments of the binded function
@param {Function} fn
@param {Object} context
@return {Function}
Bind a function to a particular context . As a consequence in the function this will correspond to the context . Additional arguments will be prepend to the arguments of the binded function