Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

Math.abs()

2 tags 1 category

The Math.abs() static method returns the absolute value of a number.

Because abs() is a static method of Math, you always use it as Math.abs(), rather than as a method of a Math object you created (Math is not a constructor).

Return value: The absolute value of x. If x is negative or -0, returns its opposite number -x (which is non-negative). Otherwise, returns x itself. The result is therefore always a positive number or 0.

Syntax example: Math.abs(x)

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…