(obj, iteratee, memo, keys, index, length)
| 1477 | }; |
| 1478 | function createReduce(dir) { |
| 1479 | function iterator(obj, iteratee, memo, keys, index, length) { |
| 1480 | for (; index >= 0 && index < length; index += dir) { |
| 1481 | var currentKey = keys ? keys[index] : index; |
| 1482 | memo = iteratee(memo, obj[currentKey], currentKey, obj); |
| 1483 | } |
| 1484 | return memo; |
| 1485 | } |
| 1486 | |
| 1487 | return function(obj, iteratee, memo, context) { |
| 1488 | iteratee = optimizeCb(iteratee, context, 4); |