Determine an average of all the numbers in the array
function average(nmbrArray) {
let sum = 0;
undef = 0;
for (var i = 0; i < nmbrArray.length; i++) {
if (nmbrArray[i] === undefined) {
undef++;
continue;
}
sum += nmbrArray[i];
}
return sum / (i - undef);
}