javascript absolute value
snippet in javascript

javascript absolute value

user2566

Math.abs(-2) // 2 
Math.abs(2) // 2 

how to get an absolute in js

user8087

var value = Math.abs(-10);
// value returns 10

js absolute value

user9887

Math.abs(-4)//returns 4
Math.abs(4)//returns 4

javascript math absolute

user6790

Math.abs(-7.25); // returns 7.25