function RandomNum(Min,Max){
var Range = Max - Min;
var Rand = Math.random();
var num = Min + Math.round(Rand * Range);
return num;
}
RandomNum(10,20);
js 获取范围内的随机数
最新推荐文章于 2024-06-18 13:31:15 发布
function RandomNum(Min,Max){
var Range = Max - Min;
var Rand = Math.random();
var num = Min + Math.round(Rand * Range);
return num;
}
RandomNum(10,20);