Wow… I was here to find the answer and forget about that when I came across this conversation between @rstorms and @camperextraordinaire. The funniest way in which Randell guided hin was excellent and rstorms finally made it… Tough bro
Hi,
what if it is function average (num1, num2)? I tried to apply this but it results to NaN or numbers not defined.
let sum = 0;
if(!numbers.length){
return sum;
}
for (let i = 0; i < numbers.length; i++){
sum += numbers[i];
}
return sum / numbers.length;
}
var output = average(4, 6);
console.log(output); // --> 5
it seems you are missing a part of the function, can you post it all if you want to ask about it?