js生成一定范围内的随机整数

Math.floor(Math.random()*(m-n+1)+n)

  

Math.floor(Math.random() * (50 - 1 + 1) + 1);

 

生成1-50内的随机整数

posted @ 2019-08-02 18:10  明明一颗大白菜  阅读(17536)  评论(0编辑  收藏  举报
<-- -->