求一个随机数功能

1d100这样的

想写安科安价了)

最新回复 (1)
  • UMP45

    10月前 6
    0 举报
    在浏览器终端里面打一个
    function getRandomInt(max) {
    return Math.floor(Math.random() * max);
    }
    console.log(getRandomInt(100))
    然后你就拿到0~100的随机数了
返回