JS 随机整数

 var ran = Math.floor(Math.random() * 10 + 1);   //   1到十的随机整数
    var ran = Math.floor(Math.random() * 10);      //   0到十的随机整数

 

posted @ 2020-03-01 17:28  曾小慧  阅读(1744)  评论(0)    收藏  举报