最近评论
正在载入评论列表...
![]() |
![]() |
Math.abs(-1);
其中-1为要求绝对值的数值。

<html>
<head>
<title>绝对值函数的使用</title>
</head>
<body>
<script language="javascript">
<!--
document.write("0的绝对值为:",Math.abs(0),"<br>");
document.write("1的绝对值为:",Math.abs(1),"<br>");
document.write("-1的绝对值为:",Math.abs(-1),"<br>");
//-->
</script>
</body>
</html>

图1.28