获取指定范围随机数

  1. function getRandomInt(min, max) {
  2. return Math.floor(Math.random() * (max - min + 1)) + min
  3. }