From 05fd7cecf4c8895c860427da15524b4435c1f0c4 Mon Sep 17 00:00:00 2001 From: jdalton Date: Tue, 17 Mar 2015 08:48:21 -0700 Subject: [PATCH] Add docs for `baseSum` and `arraySum`. [ci skip] --- lodash.src.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lodash.src.js b/lodash.src.js index 10cd55172..0dc51b8b0 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -1699,6 +1699,13 @@ return false; } + /** + * A specialized version of `_.sum` for arrays without support for iteratees. + * + * @private + * @param {Array} array The array to iterate over. + * @returns {number} Returns the sum. + */ function arraySum(array) { var length = array.length, result = 0; @@ -2757,6 +2764,15 @@ }); } + /** + * The base implementation of `_.sum` without support for callback shorthands + * and `this` binding. + * + * @private + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the sum. + */ function baseSum(collection, iteratee) { var result = 0; baseEach(collection, function(value, index, collection) {