lib/sortedArray.js
function multipleComparators(comparators) {
    return function applyComparators(a, b) {
        var i,
            result;

        for (i = 0; i < comparators.length; i++) {
            result = comparators[i](a, b);
            if (result !== 0) {
                return result;
            }
        }

        return defaultComparator(a, b);
    };
}
function multipleComparators(comparators) {
    return function applyComparators(a, b) {
        var i,
            result;

        for (i = 0; i < comparators.length; i++) {
            result = comparators[i](a, b);
            if (result !== 0) {
                return result;
            }
        }

        return defaultComparator(a, b);
    };
}
function multipleComparators ( comparators ) { return function applyComparators ( a , b ) { var i , result ; for ( i = 0 ; i < comparators . length ; i ++ ) { result = comparators [ i ] ( a , b ) ; if ( result !== 0 ) { return result ; } } return defaultComparator ( a , b ) ; } ; }
Returns a single comparator which tries all given comparators one after another
and stops if one of them returned another value than 0.

If the end is reached the defaultComparator is applied.

@private
@param {Array} comparators
@returns {Function}
Returns a single comparator which tries all given comparators one after another and stops if one of them returned another value than 0 .