flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
24
BACK_BACK/node_modules/lodash-es/sum.js
generated
vendored
Executable file
24
BACK_BACK/node_modules/lodash-es/sum.js
generated
vendored
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
import baseSum from './_baseSum.js';
|
||||
import identity from './identity.js';
|
||||
|
||||
/**
|
||||
* Computes the sum of the values in `array`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 3.4.0
|
||||
* @category Math
|
||||
* @param {Array} array The array to iterate over.
|
||||
* @returns {number} Returns the sum.
|
||||
* @example
|
||||
*
|
||||
* _.sum([4, 2, 8, 6]);
|
||||
* // => 20
|
||||
*/
|
||||
function sum(array) {
|
||||
return (array && array.length)
|
||||
? baseSum(array, identity)
|
||||
: 0;
|
||||
}
|
||||
|
||||
export default sum;
|
||||
Loading…
Add table
Add a link
Reference in a new issue