Finding the average of an array using JS

You calculate an average by adding all the elements and then dividing by the number of elements. The reason you got 68 as your result is because in your loop, you keep overwriting your average, so the final value will be the result of your last calculation. And your division and multiplication by grades.length cancel … Read more

Javascript onload not working

I am using an external javascript file, which I am using to store all my javascript functions in. Next I am trying to call a function from the body, using the next line of code: The only thing that this function does is making an alert box pop up, well that’s what’s it supposed to … Read more