vendor/optional/lodash-0.3.2.js
function reduceRight(collection, callback, accumulator, thisArg) {
    if (!collection) {
      return accumulator;
    }

    var length = collection.length,
        noaccum = arguments.length < 3;

    if(thisArg) {
      callback = iteratorBind(callback, thisArg);
    }
    if (length === length >>> 0) {
      if (length && noaccum) {
        accumulator = collection[--length];
      }
      while (length--) {
        accumulator = callback(accumulator, collection[length], length, collection);
      }
      return accumulator;
    }

    var prop,
        props = keys(collection);

    length = props.length;
    if (length && noaccum) {
      accumulator = collection[props[--length]];
    }
    while (length--) {
      prop = props[length];
      accumulator = callback(accumulator, collection[prop], prop, collection);
    }
    return accumulator;
  }
function reduceRight(collection, callback, accumulator, thisArg) {
    if (!collection) {
      return accumulator;
    }

    var length = collection.length,
        noaccum = arguments.length < 3;

    if(thisArg) {
      callback = iteratorBind(callback, thisArg);
    }
    if (length === length >>> 0) {
      if (length && noaccum) {
        accumulator = collection[--length];
      }
      while (length--) {
        accumulator = callback(accumulator, collection[length], length, collection);
      }
      return accumulator;
    }

    var prop,
        props = keys(collection);

    length = props.length;
    if (length && noaccum) {
      accumulator = collection[props[--length]];
    }
    while (length--) {
      prop = props[length];
      accumulator = callback(accumulator, collection[prop], prop, collection);
    }
    return accumulator;
  }
function reduceRight ( collection , callback , accumulator , thisArg ) { if ( ! collection ) { return accumulator ; } var length = collection . length , noaccum = arguments . length < 3 ; if ( thisArg ) { callback = iteratorBind ( callback , thisArg ) ; } if ( length === length >>> 0 ) { if ( length && noaccum ) { accumulator = collection [ -- length ] ; } while ( length -- ) { accumulator = callback ( accumulator , collection [ length ] , length , collection ) ; } return accumulator ; } var prop , props = keys ( collection ) ; length = props . length ; if ( length && noaccum ) { accumulator = collection [ props [ -- length ] ] ; } while ( length -- ) { prop = props [ length ] ; accumulator = callback ( accumulator , collection [ prop ] , prop , collection ) ; } return accumulator ; }
The right-associative version of `_.reduce`.

@static
@memberOf _
@alias foldr
@category Collections
@param {Array|Object} collection The collection to iterate over.
@param {Function} callback The function called per iteration.
@param {Mixed} [accumulator] Initial value of the accumulator.
@param {Mixed} [thisArg] The `this` binding for the callback.
@returns {Mixed} Returns the accumulated value.
@example

var list = [[0, 1], [2, 3], [4, 5]];
var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []);
// => [4, 5, 2, 3, 0, 1]
The right - associative version of _ . reduce .