dave dave - 11 months ago 101
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)