Prev Demo
Absolute Values For Diffrent Numbers And Strings
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <h1>Absolute values</h1> <script> var a = Math.abs(3.5); document.write("The absolute value of -3.5 is :" + a); var b = Math.abs(-3.5); document.write("</br>The absolute value of 3.5 is :" + b); var c = Math.abs("TechFunda"); document.write("</br>The absolute value of 'TecFunda' is :" + c); </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output