From 91b5072d2b714b2eb84308bac64629dbcc0104b0 Mon Sep 17 00:00:00 2001 From: UdhavKumar <61343874+UdhavKumar@users.noreply.github.com> Date: Sun, 4 Oct 2020 19:19:44 +0530 Subject: [PATCH] Improved Documentation (#329) * Update AverageMean.js * Update AverageMean.js Co-authored-by: vinayak --- Maths/AverageMean.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Maths/AverageMean.js b/Maths/AverageMean.js index d0dc833c5..28f96d53e 100644 --- a/Maths/AverageMean.js +++ b/Maths/AverageMean.js @@ -1,3 +1,4 @@ +'use strict' /* author: PatOnTheBack license: GPL-3.0 or later @@ -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 })