GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.geeksforgeeks.org — JavaScript Math abs() Method - GeeksforGeeks JavaScript Math abs() MethodLast Updated : 15 Jul, 2024 Javascript 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:Math.abs(value)Parameters:This method accepts a single parameter as mentioned above and described below:
Return Value:The absolute value of the number passed as a parameter. The below examples illustrate the Math abs( ) method in JavaScript: Example 1: This example shows the use of the Math.abs() method in javascript.
Output 2 2.56 Example 2: This example shows the return value of Math.abs() method when the parameter is a string value.
Output NaN Example 3: This example shows the return value of Math.abs() method when the parameter is an arithmetic expression.
Output 16 Errors and Exceptions:
We have a complete list of Javascript Math Objects methods, to check those please go through this Javascript Math Object Complete reference article. Supported Browsers
Comment Explore |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |