JavaScript absolute
Math.abs() returns the absolute value of a number. Its distance from zero, always non-negative.
Syntax
Math.abs(num) Examples
| Input | Arguments | Output |
|---|---|---|
| -5 | — | 5 |
Try it live
Type your input and see absolute transform it instantly.
Want to go further? Chain absolute with other functions, pipe one output into the next and watch your data transform in the visual Playground.