Math.abs()
Get the absolute value of a number.
Description
The Math.abs()
method returns the absolute value of val, which is a
Number.
Examples
-
Get the absolute value of an integer:
Math.abs(5)
5
-
Get the absolute value of a negative integer:
Math.abs(-5)
5
-
Get the absolution value of a real number:
Math.abs(-5.1)
5.1
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!