averageBig

Write a JavaScript function named averageBig with this headerfunction averageBig(list) {
The parameter list is an array that contains numbers. The length of the list array will vary. Your function must compute the average of all the numbers stored in the array that are larger than 1000. For example, if your function were called like this:var list = [70, 1010, 950, 2014, 6];
var score = averageBig(list);
your function would return the number 1512. If none of the numbers in the array are larger than 1000, your function must return 0 (zero).Test Cases
Parameter Return
list
[ 70, 1010, 950, 2014, 6 ] 1512
[ -72.3, 3000, 873, 2312, 68, 7501.3 ] 4271.1
[ 70, 950, 671, 6 ] 0

×
New Download