UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

14 lines (10 loc) 280 B
'use strict'; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); function sumBy(items, getValue) { let result = 0; for (let i = 0; i < items.length; i++) { result += getValue(items[i], i); } return result; } exports.sumBy = sumBy;