well.js
function checkCallbacks(start, arrayOfCallbacks) {
            // TODO: Promises/A+ update type checking and docs
            var arg, i = arrayOfCallbacks.length;

            while (i > start) {
                arg = arrayOfCallbacks[--i];

                if (arg != null && typeof arg != 'function') {
                    throw new Error('arg ' + i + ' must be a function');
                }
            }
        }
function checkCallbacks(start, arrayOfCallbacks) {
            // TODO: Promises/A+ update type checking and docs
            var arg, i = arrayOfCallbacks.length;

            while (i > start) {
                arg = arrayOfCallbacks[--i];

                if (arg != null && typeof arg != 'function') {
                    throw new Error('arg ' + i + ' must be a function');
                }
            }
        }
function checkCallbacks ( start , arrayOfCallbacks ) { // TODO: Promises/A+ update type checking and docs var arg , i = arrayOfCallbacks . length ; while ( i > start ) { arg = arrayOfCallbacks [ -- i ] ; if ( arg != null && typeof arg != 'function' ) { throw new Error ( 'arg ' + i + ' must be a function' ) ; } } }
Helper that checks arrayOfCallbacks to ensure that each element is either
a function, or null or undefined.
@private
@param {number} start index at which to start checking items in arrayOfCallbacks
@param {Array} arrayOfCallbacks array to check
@throws {Error} if any element of arrayOfCallbacks is something other than
a functions, null, or undefined.
Helper that checks arrayOfCallbacks to ensure that each element is either a function or null or undefined .