I want Math.map from machine code to work in javascript

I have a code from a machine that i use to make a variable (550-1023) to equal a better variable (90-180) I was wondering if it was possible to make it work (or at least a good alternative) for it. the machine code:

variable = Math.map(value, 550, 1023, 90, 180);

I just need to make it so that when one variable (value low:550 high:1023) equals another variable (variable low:90 high:180). so one variable is 550 while the other is 90, and one is 1023 and the other is 180.

No there isn’t, unfortunately. But if you normalize your initial value to be between 0-1:

var normalizedValue = (value - 550) / (1023 - 550);

…you can then “lerp” the normalized value to the new range:

var newValue = pc.math.lerp(90, 180, normalizedValue);

Thank you, that worked for what I needed.