average function
dynamic
average(
- dynamic vs
Implementation
function average(vs) {
let sum = 0;
for (let i = 0; i < vs.length; i += 1) {
sum += vs[i];
}
return sum / vs.length;
}