logo CodeStepByStep logo

removeRange

Language/Type: JavaScript arrays

Write a function named removeRange that accepts an array of numbers and two integer values min and max as parameters and removes all elements values in the range min through max (inclusive).

For example, if an array named arr stores [7, 9, 4, 2.4, 7, 7, 5.5, 3, 5, 1, 7, 8, 6, 7], the call of removeRange(arr, 5, 7) should change the array to store [9, 4, 2.4, 3, 1, 8].

You may assume the array passed is non-null and contains only numbers.

Function: Write a JavaScript function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.