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