diff --git a/src/math/sum.ts b/src/math/sum.ts index 1f20fbd5..44343c38 100644 --- a/src/math/sum.ts +++ b/src/math/sum.ts @@ -14,8 +14,8 @@ export function sum(nums: readonly number[]): number { let result = 0; - for (const num of nums) { - result += num; + for (let i = 0; i < nums.length; i++) { + result += nums[i]; } return result;