Average of an Array of Numbers Function

The function goes through each array index number, takes the value of
that index number and adds it the sum. After which, it divides the
final sum by the length of the array and returns the average outside
the function.