Math.abs( ) Method
Below is the example of the Math abs() method.
Example:
Output
The Math.abs() method is used to return the absolute value of a number. It takes a number as its parameter and returns its absolute value.
Syntax:
Parameters: This method accepts a single parameter as mentioned above and described below:
value: The number whose absolute value is to be found is passed as the parameter to this function.
Returns: Absolute value of the number passed as parameter.
Last updated