Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Maths/AverageMean.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use strict'
/*
author: PatOnTheBack
license: GPL-3.0 or later
Expand All @@ -11,12 +12,12 @@
https://en.wikipedia.org/wiki/Mean
*/

function mean (nums) {
'use strict'
const mean = (nums) => {
// This is a function returns average/mean of array
var sum = 0
var avg

// This loop sums all values in the 'nums' array.
// This loop sums all values in the 'nums' array using forEach loop
nums.forEach(function (current) {
sum += current
})
Expand Down