//获得随机数传入(最小值,最大值)
export const getRandomIntInclusive = (min, max) => {
min = Math.ceil(min)
max = Math.floor(max)
return Math.floor(Math.random() * (max - min + 1)) + min // 含最大值,含最小值
}
1-JS获得规定范围的随机数
于 2022-03-17 10:03:41 首次发布