Question: Write a defining table and a function that returns the value of the middle element in an array. If the array has an even number

Write a defining table and a function that returns the value of the middle element in an array. If the array has an even number of elements, then this function must return the average of the two middle elements. The function must have this header:

function getMiddle(list)

Use this code to test function:

Functions With Arrays

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 Databases Questions!