Skip to content

Commit 4fd01a7

Browse files
authored
Merge pull request vJechsmayr#113 from MikaTheLeek/feature/mean
Mean-Average
2 parents d65cb5a + 000f8ac commit 4fd01a7

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎Maths/mean.js‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
let mean = arr => {
2+
3+
let sum = 0;
4+
arr.forEach(element => sum += element );
5+
6+
return sum / arr.length;
7+
};
8+
9+
const arr = [2,9,6,5,4,7,12];
10+
console.log(mean(arr));

0 commit comments

Comments
 (0)