Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
|
|
@ -1,4 +1,9 @@
|
|||
function mean(a)
|
||||
{
|
||||
return a.length ? Functional.reduce('+', 0, a) / a.length : 0;
|
||||
}
|
||||
function mean(array) {
|
||||
var sum = 0;
|
||||
array.forEach(function(value){
|
||||
sum += value;
|
||||
});
|
||||
return array.length ? sum / array.length : 0;
|
||||
}
|
||||
|
||||
alert( mean( [1,2,3,4,5] ) ); // 3
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue