codecamp

JavaScript 使用random()生成随机数

var randomNumberBetween0and19 = Math.floor(Math.random() * 20);


function myFunction() {


// Only change code below this line.


return Math.floor(Math.random()*10);
}

JavaScript 使用random()生成随机小数
JavaScript 使用random()在一个范围内生成随机数
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定