JS中Math有许多对象,这次我们需要自己讲的就是Math对象
Math对象就是方便我们运算的一个对象;
实际使用如下:
使用方法如下:
var x = Math.abs(t); //t是一个变量,使用方法就是大致如此~
给上一个实例代码感受一下:
<html>
<body>
<script type="text/javascript">
document.write(Math.round() + "<br />")
document.write(Math.round() + "<br />")
document.write(Math.round() + "<br />")
document.write(Math.round(-) + "<br />")
document.write(Math.round(-))
</script>
</body>
</html>