UNPKG

@qntm-code/utils

Version:

A collection of useful utility functions with associated TypeScript types. All functions have been unit tested.

10 lines (9 loc) 258 B
/** * Returns a random whole number between a given range */ export function randomNumberBetweenRange(min, max) { min = Math.ceil(min); max = Math.floor(max); const value = Math.random() * (max - min + 1) + min; return Math.floor(value); }