I have two numbers MAX = 200, MIN = 110 now a random number, let's say 120 which could only be between these two numbers(MAX & MIN).
Now I want to scale down MAX = 10, MIN = 1 & random number to its corresponding value between new MAX & MIN which in this case is 2. How can I write an optimised JavaScript function that can do that?