JS 随机整数

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