Calculate Average


You should note that when I define theAvg using var in the function, I cannot see the document write of the answer from the script in the Body. That is because variables defined within a function are local. If you define them outside the function they are global. Omitting the word var gets around this but is not considered a great coding technique.