We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ff314a2 commit 1276daaCopy full SHA for 1276daa
Maths/AverageMean.js
@@ -13,7 +13,7 @@ const mean = (nums) => {
13
throw new TypeError('Invalid Input')
14
}
15
16
- // This loop sums all values in the 'nums' array using forEach loop
+ // This calculates the sum of all values in the 'nums' array using reduce method.
17
const sum = nums.reduce((sum, cur) => sum + cur, 0)
18
19
// Divide sum by the length of the 'nums' array.
0 commit comments