mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 18:17:48 +00:00
Bump to v4.14.0.
This commit is contained in:
5
sumBy.js
5
sumBy.js
@@ -11,8 +11,7 @@ import baseSum from './_baseSum.js';
|
||||
* @since 4.0.0
|
||||
* @category Math
|
||||
* @param {Array} array The array to iterate over.
|
||||
* @param {Array|Function|Object|string} [iteratee=_.identity]
|
||||
* The iteratee invoked per element.
|
||||
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
|
||||
* @returns {number} Returns the sum.
|
||||
* @example
|
||||
*
|
||||
@@ -27,7 +26,7 @@ import baseSum from './_baseSum.js';
|
||||
*/
|
||||
function sumBy(array, iteratee) {
|
||||
return (array && array.length)
|
||||
? baseSum(array, baseIteratee(iteratee))
|
||||
? baseSum(array, baseIteratee(iteratee, 2))
|
||||
: 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user