3 ms·
here is the source for that npm package https://github.com/bytespider/average/blob/master/src/average.js https://github.com/bytespider/average/blob/master/src/
by metaphorm 11y ago
here is the source for that npm package
https://github.com/bytespider/average/blob/master/src/average.js https://github.com/bytespider/average/blob/master/src/averag...
and here is the code copied out in full
module.exports = function average(values) {
for (var i = 0, sum = 0; i < values.length; ++i) {
sum += values[i];
}
return sum / values.length;
};
is this worth adding a dependency to your build for?