Math.abs()
Get the absolute (positive) value of a number.
// returns 42
Math.abs(42);
// also returns 42
Math.abs(-42);
Works back to at least IE6.
Get the absolute (positive) value of a number.
// returns 42
Math.abs(42);
// also returns 42
Math.abs(-42);
Works back to at least IE6.