2 * The base implementation of `_.sum` and `_.sumBy` without support for
6 * @param {Array} array The array to iterate over.
7 * @param {Function} iteratee The function invoked per iteration.
8 * @returns {number} Returns the sum.
10 function baseSum(array, iteratee) {
13 length = array.length;
15 while (++index < length) {
16 var current = iteratee(array[index]);
17 if (current !== undefined) {
18 result = result === undefined ? current : (result + current);
24 module.exports = baseSum;