Skip to content

Commit 91b5072

Browse files
Improved Documentation (#329)
* Update AverageMean.js * Update AverageMean.js Co-authored-by: vinayak <[email protected]>
1 parent 1b9b73c commit 91b5072

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Maths/AverageMean.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
'use strict'
12
/*
23
author: PatOnTheBack
34
license: GPL-3.0 or later
@@ -11,12 +12,12 @@
1112
https://en.wikipedia.org/wiki/Mean
1213
*/
1314

14-
function mean (nums) {
15-
'use strict'
15+
const mean = (nums) => {
16+
// This is a function returns average/mean of array
1617
var sum = 0
1718
var avg
1819

19-
// This loop sums all values in the 'nums' array.
20+
// This loop sums all values in the 'nums' array using forEach loop
2021
nums.forEach(function (current) {
2122
sum += current
2223
})

0 commit comments

Comments
 (0)