tweb/src/helpers/number/getRandomInt.ts
2022-11-06 17:48:41 +04:00

6 lines
176 B
TypeScript

export default function getRandomInt(min: number, max: number) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min;
}