source:
node_modules/es-toolkit/dist/math/sumBy.mjs
| Last change on this file was a762898, checked in by , 5 months ago | |
|---|---|
|
|
| File size: 186 bytes | |
| Rev | Line | |
|---|---|---|
| [a762898] | 1 | function sumBy(items, getValue) { |
| 2 | let result = 0; | |
| 3 | for (let i = 0; i < items.length; i++) { | |
| 4 | result += getValue(items[i], i); | |
| 5 | } | |
| 6 | return result; | |
| 7 | } | |
| 8 | ||
| 9 | export { sumBy }; |
Note:
See TracBrowser
for help on using the repository browser.
