<!DOCTYPE html> <html> <body> <h1>JavaScript 数学</h1> <p>Math.abs() 返回数的绝对值:</p> <p id="demo"></p> <script> document.getElementById("demo").innerHTML = Math.abs(-7.25); </script> </body> </html>