UNPKG

@digital-blueprint/lunchlottery-app

Version:

[GitHub Repository](https://github.com/digital-blueprint/lunchlottery-app) | [npmjs package](https://www.npmjs.com/package/@digital-blueprint/lunchlottery-app) | [Unpkg CDN](https://unpkg.com/browse/@digital-blueprint/lunchlottery-app/)

7 lines (6 loc) 263 B
export const getRandomInt = (min, max) => { const minCeiled = Math.ceil(min); const maxFloored = Math.floor(max); // The maximum is exclusive and the minimum is inclusive return Math.floor(Math.random() * (maxFloored - minCeiled) + minCeiled); };