js math对象

Math对象
执行常见的算数任务
常用方法
round()四舍五入
random()返回0~1之间的随机数
max():返回最高值
min():返回中的最低值
abs():返回绝对值
-->

<script>
// document.write(Math.round(2.3));

document.write(Math.random()*10);
document.write(parseInt(Math.random()*10));//int 类型
document.write(Math.max("23","43","53","3"));
document.write(Math.abs("-23"));
</script>

posted @ 2015-05-20 00:44  谢小锋  阅读(104)  评论(0编辑  收藏  举报