function extractArgs(args) {
        var extracted = {};
        
        $.each(args, function (i, arg) {
            switch (arg.constructor) {
            case Function:
                extracted.successFn = extracted.successFn || arg;
                extracted.failureFn = !extracted.successFn && arg;
                break;
            case Object:
                extracted.options = arg;
            }
        });
        
        return extracted;
    }
/**
     * Extract callback and options arguments from the given arguments array,
     * based on the type and order of arguments:
     * <ul>
     * <li>The first Function encountered is used as the success/done callback.
     * </li>
     * <li>Second Function becomes the failure callback.</li>
     * <li>An Object becomes the options argument.</li>
     * <li>Arguments of other types are ignored.</li>
     * </ul>
     */
Extract callback and options arguments from the given arguments array,
based on the type and order of arguments:

The first Function encountered is used as the success/done callback.

Second Function becomes the failure callback.
An Object becomes the options argument.
Arguments of other types are ignored.

Extract callback and options arguments from the given arguments array based on the type and order of arguments : The first Function encountered is used as the success / done callback . Second Function becomes the failure callback . An Object becomes the options argument . Arguments of other types are ignored .
function extractArgs(args) {
        var extracted = {};
        $.each(args, function (i, arg) {
            switch (arg.constructor) {
            case Function:
                extracted.successFn = extracted.successFn || arg;
                extracted.failureFn = !extracted.successFn && arg;
                break;
            case Object:
                extracted.options = arg;
            }
        });
        return extracted;
    }
function extractArgs ( args ) { var extracted = { } ; $ . each ( args , function ( i , arg ) { switch ( arg . constructor ) { case Function : extracted . successFn = extracted . successFn || arg ; extracted . failureFn = ! extracted . successFn && arg ; break ; case Object : extracted . options = arg ; } } ) ; return extracted ; }
Extract callback and options arguments from the given arguments array,
 based on the type and order of arguments:
 <ul>
 <li>The first Function encountered is used as the success/done callback.
Extract callback and options arguments from the given arguments array based on the type and order of arguments : <ul > <li > The first Function encountered is used as the success / done callback .