dave dave - 5 months ago 39
Javascript Question

Convert a negative number to a positive one in JavaScript

Is there a math function in JavaScript that converts numbers to positive value?

Answer

You could use this...

Math.abs(x)