// 左臂右开
function getRandom(min, max) {
return Math.floor(Math.random() * (max - min) + min)
}
let number = getRandom(1, 6)
console.log(number)
js给定最小范围和最大范围获取随机区间值
最新推荐文章于 2023-05-10 23:31:13 发布
// 左臂右开
function getRandom(min, max) {
return Math.floor(Math.random() * (max - min) + min)
}
let number = getRandom(1, 6)
console.log(number)