Initial commit
[yaffs-website] / node_modules / grunt-contrib-watch / node_modules / lodash / internal / arraySum.js
1 /**
2  * A specialized version of `_.sum` for arrays without support for callback
3  * shorthands and `this` binding..
4  *
5  * @private
6  * @param {Array} array The array to iterate over.
7  * @param {Function} iteratee The function invoked per iteration.
8  * @returns {number} Returns the sum.
9  */
10 function arraySum(array, iteratee) {
11   var length = array.length,
12       result = 0;
13
14   while (length--) {
15     result += +iteratee(array[length]) || 0;
16   }
17   return result;
18 }
19
20 module.exports = arraySum;