mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 17:47:49 +00:00
Use more for-of
This commit is contained in:
@@ -8,11 +8,9 @@
|
||||
*/
|
||||
function baseSum(array, iteratee) {
|
||||
let result
|
||||
let index = -1
|
||||
const { length } = array
|
||||
|
||||
while (++index < length) {
|
||||
const current = iteratee(array[index])
|
||||
for (value of array) {
|
||||
const current = iteratee(value)
|
||||
if (current !== undefined) {
|
||||
result = result === undefined ? current : (result + current)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user