mirror of
http://36.133.248.69:3088/admin/RentWeAppFront.git
synced 2026-03-08 09:52:26 +08:00
11 lines
196 B
JavaScript
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;
|