You could use this…
x *= -1? I like its simplicity.
Math.abs(x) or if you are certain the value is negative before the conversion just prepend a regular minus sign:
x = -x.
The minus sign (-) can convert positive numbers to negative numbers and negative numbers to positive numbers.
x=-y is visual sugar for
var y = -100; var x =- y;
unsigned_value = Math.abs(signed_value);
var posNum = (num < 0) ? num * -1 : num; // if num is negative multiple by negative one ...
I find this solution easy to understand.