I want to get the absolute value of a number in JavaScript. That is, drop the sign. I know mathematically I can do this by squaring the number then taking the square root, b
I think you are looking for Math.abs(x)
Math.abs(x)
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Math/abs