X214: arrayAverage

Write a method called arrayAverage() that takes an array of zero or more integer values, and computes the average (mean) of all values in the array, or zero if there are no values.

Examples:

arrayAverage({1, 2, 3}) -> 2
arrayAverage({3, 4}) -> 3.5

Your Answer:

Feedback

Your feedback will appear here when you check your answer.