mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 08:57:49 +00:00
Complete identity removal module. (#2993)
This commit is contained in:
committed by
John-David Dalton
parent
39931f9eaa
commit
d460c42230
3
sum.js
3
sum.js
@@ -1,5 +1,4 @@
|
||||
import baseSum from './.internal/baseSum.js'
|
||||
import identity from './identity.js'
|
||||
|
||||
/**
|
||||
* Computes the sum of the values in `array`.
|
||||
@@ -15,7 +14,7 @@ import identity from './identity.js'
|
||||
*/
|
||||
function sum(array) {
|
||||
return (array && array.length)
|
||||
? baseSum(array, identity)
|
||||
? baseSum(array, value => value)
|
||||
: 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user