random method
Returns a pseudo-random number between zero and one. This method is available on Unix platforms only.
语法
Math.random()
Method of
Math
例子
//Displays a random number between 0 and 1
document.write("The random number is " + Math.random())
本文介绍了如何使用Math.random()方法在Unix平台上生成介于0到1之间的伪随机数。通过一个简单的示例展示了如何在网页中显示这个随机数。
Returns a pseudo-random number between zero and one. This method is available on Unix platforms only.
Math.random()
Math
//Displays a random number between 0 and 1
document.write("The random number is " + Math.random())
1132

被折叠的 条评论
为什么被折叠?