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