Generate a random integer in given range
JavaScript
const randomInteger = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min
TypeScript
const randomInteger = (min: number, max: number): number => Math.floor(Math.random() * (max - min + 1)) + min