JavaScript中的Math.random()函数
random()Math对象的函数返回0.0到1.0之间的浮点随机数。范围是:0.0=<Math.random<1.0。通过使用算术运算可以实现不同的范围。
语法
它的语法如下
Math.random();
示例
<html>
<head>
<title>JavaScript Example</title>
</head>
<body>
<script type="text/javascript">
var result = Math.random(48, 2);
document.write("Result "+result);
</script>
</body>
</html>输出结果
Result 0.16413337253303162
热门推荐
10 财运虎年祝福语简短语
11 单亲爸爸春节祝福语简短
12 狗狗上厕所训练
13 植物种植祝福语简短
14 翻译考试祝福语朋友简短
15 个人周年庆简短祝福语
16 狗狗怎么训练
17 分别祝福语简短搞笑英文
18 生日广州男生祝福语简短