js 生成随机数
作者:互联网
//生成从minNum到maxNum的随机数 function randomNum(minNum,maxNum){ switch(arguments.length){ case 1: return parseInt(Math.random()*minNum+1,10); break; case 2: return parseInt(Math.random()*(maxNum-minNum+1)+minNum,10); break; default: return 0; break; } }
标签:case,10,return,生成,break,minNum,随机数,maxNum,js 来源: https://www.cnblogs.com/chengfengchi/p/13582843.html