asd/asd-pc/node_modules/uview-ui/libs/function/random.js
愉快的大福 eb8378e551 init
2024-11-21 11:06:22 +08:00

11 lines
196 B
JavaScript

function random(min, max) {
if (min >= 0 && max > 0 && max >= min) {
let gab = max - min + 1;
return Math.floor(Math.random() * gab + min);
} else {
return 0;
}
}
export default random;