Math.random()

Math.random()    //  0~1(不包含0和1的任意数)

Math.random()*100  // 0~99.99..

Math.random()*100 +1 // 1~100.99..

Math.floor(Math.random()*100 + 1)  // 向下取整,1~100(包含1和100)

posted on 2017-11-23 11:02  洋芋懒疙瘩  阅读(130)  评论(0)    收藏  举报