JavaScript version
randomInteger.js
const randomInteger = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;
TypeScript version
randomInteger.ts
const randomInteger = (min: number, max: number): number => Math.floor(Math.random() * (max - min + 1)) + min;