lodash/lodash — pull request #701 by theporchrat (2014-09-03 02:42:43+00:00)
Title: add additional check to see if thisArg is provided without an Accumulator

I ran into this trying to set the `thisArg` while explicitly setting `accumulator`to be `undefined`.

var result = _.reduce([1,2,3], callback, undefined, this)

The above results in the the first iteration of the callback to be called with index 0 and the result as undefined, instead of index 1 and `1` as the result value. I just did a strict check for `accumulator === undefined` which makes this change "broader" than my particular edge case, but it could also easily be `arguments.length < 3 || (arguments.length === 4 && accumulator === undefined)` if you want to still allow a specific case where you can intentionally set the accumulator to `undefined`.

I realize this is sort of a toss up on which edge case makes the most sense, though right before 3.0.0 makes it a good time to alter this if it made sense.