Skip to content

Commit 1276daa

Browse files
author
Hridyanshu7
committed
docs: fixed misleading comment about the array method (forEach instead of reduce) used in AverageMean.js
1 parent ff314a2 commit 1276daa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: Maths/AverageMean.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const mean = (nums) => {
1313
throw new TypeError('Invalid Input')
1414
}
1515

16-
// This loop sums all values in the 'nums' array using forEach loop
16+
// This calculates the sum of all values in the 'nums' array using reduce method.
1717
const sum = nums.reduce((sum, cur) => sum + cur, 0)
1818

1919
// Divide sum by the length of the 'nums' array.

0 commit comments

Comments
 (0)