Return the average of an array of numbers

Write a function that takes an array of numbers as argument. It should return the average of the numbers.
function
myFunction
(
arr
)
{

return
}
Test Cases:
myFunction([10,100,40])
Expected
50
myFunction([10,100,1000])
Expected
370
myFunction([-50,0,50,200])
Expected
50

How to solve it

The average of an array of numbers is the sum of all numbers divided by the length of the array (i.e. the number of elements).
So, in order to solve this challenge, you need to know how to get the number of elements in an array and how to get the sum of those elements. We have covered those topics in the following challenges:
Combine the code of these challenges to solve the current one.