📜  如何在javascript代码示例中生成随机数

📅  最后修改于: 2022-03-11 15:03:58.128000             🧑  作者: Mango

代码示例6
// min value of the random number
var min = 5;

// max value of the random number
var max = 25;

// generate the random number
var rdm = (Math.random() * (max - min)) + min

// generate the random number without "."
var rdm = Math.round((Math.random() * (max - min)) + min)