Math ऑब्जेक्ट का abs() फंक्शन एक नंबर स्वीकार करता है और उसका निरपेक्ष मान (absolute value) लौटाता है।
सिंटैक्स
इसका सिंटैक्स निम्नानुसार है:
Math.abs(x)
उदाहरण
<html> <head> <title>JavaScript Example</title> </head> <body> <script type="text/javascript"> var result = Math.abs(3); document.write("Absolute value: "+result); </script> </body> </html>
आउटपुट
Absolute value: 3