ovy.functions.js
function(fn, args, scope) {
            if (!ovy.isArray(args)) {
                if (ovy.isIterable(args)) {
                    args = arrays.clone(args);
                } else {
                    args = args !== undefined ? [args] : [];
                }
            }

            return function() {
                var fnArgs = [].concat(args);
                fnArgs.push.apply(fnArgs, arguments);
                return fn.apply(scope || this, fnArgs);
            };
        }
function(fn, args, scope) {
            if (!ovy.isArray(args)) {
                if (ovy.isIterable(args)) {
                    args = arrays.clone(args);
                } else {
                    args = args !== undefined ? [args] : [];
                }
            }

            return function() {
                var fnArgs = [].concat(args);
                fnArgs.push.apply(fnArgs, arguments);
                return fn.apply(scope || this, fnArgs);
            };
        }
function ( fn , args , scope ) { if ( ! ovy . isArray ( args ) ) { if ( ovy . isIterable ( args ) ) { args = arrays . clone ( args ) ; } else { args = args !== undefined ? [ args ] : [ ] ; } } return function ( ) { var fnArgs = [ ] . concat ( args ) ; fnArgs . push . apply ( fnArgs , arguments ) ; return fn . apply ( scope || this , fnArgs ) ; } ; }
Create a new function from the provided `fn`, the arguments of which are pre-set to `args`.
New arguments passed to the newly created callback when it's invoked are appended after the pre-set ones.
This is especially useful when creating callbacks.

For example:

var originalFunction = function(){
alert(ovy.arrays.from(arguments).join(' '));
};

var callback = ovy.functions.pass(originalFunction, ['Hello', 'World']);

callback(); // alerts 'Hello World'
callback('by Me'); // alerts 'Hello World by Me'

{@link ovy#pass ovy.pass} is alias for {@link ovy.functions#pass ovy.functions.pass}

@param {Function} fn The original function
@param {Array} args The arguments to pass to new callback
@param {Object} scope (optional) The scope (`this` reference) in which the function is executed.
@return {Function} The new callback function
Create a new function from the provided fn the arguments of which are pre - set to args . New arguments passed to the newly created callback when it s invoked are appended after the pre - set ones . This is especially useful when creating callbacks .