DemuMesDataV/util/index.js

8 lines
221 B
JavaScript
Raw Normal View History

2019-06-25 19:57:04 +08:00
export function randomExtend (minNum, maxNum) {
if (arguments.length === 1) {
return parseInt(Math.random() * minNum + 1, 10)
} else {
return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10)
}
}