📜  js 随机数 - Javascript 代码示例

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

代码示例6
// You can make functions aswell 
function randomNum(min, max) {
    return Math.floor(Math.random() * (max - min)) + min; // You can remove the Math.floor if you don't want it to be an integer
}