Can someone more intelligent than me please solve this simple math conversion that I need to accomplish within javascript.
If I have an ordered array of numbers say...
var values = [99, 101, 102, 103, 104];
var low = 99;
var high = 104;
...and I need the highest value in the array to be pushed to a new array as the value 1, and the second highest value to be pushed to the new array as 2, etc., so the new array is...
var newArray = [1, 2, 3, 4, 6];
I can make a hack version that works but I need a solution that will work on arrays with diverse number values. Appreciate the help!
1instead of104. If there is no reason then simplyArray.fillwill work