mirror of
https://github.com/photonstorm/phaser
synced 2024-12-24 03:53:28 +00:00
15 lines
209 B
JavaScript
15 lines
209 B
JavaScript
|
var Average = function ()
|
||
|
{
|
||
|
var sum = 0;
|
||
|
var len = arguments.length;
|
||
|
|
||
|
for (var i = 0; i < len; i++)
|
||
|
{
|
||
|
sum += (+arguments[i]);
|
||
|
}
|
||
|
|
||
|
return sum / len;
|
||
|
};
|
||
|
|
||
|
module.exports = Average;
|