随机数公式

313 阅读1分钟

返回两个随机数,并包含这两个数

Math.floor(Math.random()*(max-min+1)+min)

返回两个随机数,包含最小值,不包含最大值

Math.floor(Math.random()*(max-min)+min)