I’m looking to write a function
function range (arr) which takes an array, finds the highest and lowest value of that array, subtracts those values and return the total. So for example, the array
[6,2,3,4,9,6,1,0,5]) would return 8, as 9 is the highest, 1 is the lowest, and then would subtract the two.
Any help would be greatly appreciated.