8 lines
221 B
JavaScript
8 lines
221 B
JavaScript
|
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)
|
||
|
}
|
||
|
}
|