码迷,mamicode.com
首页 > Web开发 > 详细

js Math对象

时间:2014-12-25 16:27:26      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:js基础

1.常用的有Math.PI,Math.min()和Math.max();其中min和max可以穿进去参数比如var a = Math.min(2,5,8,1,4);来获取最小值。

2.random方法,常常用来获取随机的

值 = Math.floor(Math.random() * 数组的总数 + 第一个可能的值)

js Math对象

标签:js基础

原文地址:http://blog.csdn.net/zerofine/article/details/42147085

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!