📜  js 数学随机 - Javascript 代码示例

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

代码示例6
var n = Math.random();
n = Math.floor((n * 6) + 1); // if you want your numbers to start at 1 and end at 6 
console.log(n);