//默认为范围为10,开始值为1
function random(range = 10, start = 1) {
return Math.floor(Math.random() * range + start);
}
JS生成随机数函数
最新推荐文章于 2024-05-24 17:41:07 发布
//默认为范围为10,开始值为1
function random(range = 10, start = 1) {
return Math.floor(Math.random() * range + start);
}