Question: 4 . arrayAverage function a ) Write a function named arrayAverage that accepts an array of numbers and returns the average of those numbers. b

4. arrayAverage function
a) Write a function named arrayAverage that accepts an array of numbers and returns the average of those numbers.
b) Run the test shown below in the console to verify your function works properly.
// Test
let values =[31.9,31.3,42.4,42.4,60.8,28.1]; console.log(arrayAverage(values)); //expect 39.48333...
c) Add code in your JavaScript file to call the arrayAverage function with an argument of [31.9,31.3,42.4,42.4,60.8,28.1] and displays what it returns in the textarea of the web page by concatenating to the textarea value.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!