rand.ts 210 B

12345
  1. export const getRandomIntInRange = (min: number, max: number): number => {
  2. const minInt = Math.ceil(min);
  3. const maxInt = Math.floor(max);
  4. return Math.floor(Math.random() * (maxInt - minInt) + minInt);
  5. };