JS 随机数详解编程语言

function GetRandomNum(Min,Max){
  var Range = Max – Min;
  var Rand = Math.random();
  return(Min + Math.round(Rand * Range));
}

var num = GetRandomNum(10,99);

原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/17359.html

(0)
上一篇 2021年7月19日 20:09
下一篇 2021年7月19日 20:09

相关推荐

发表回复

登录后才能评论