UNPKG

@squirrel-forge/ui-util

Version:

A collection of utilities, classes, functions and abstracts made for the browser and babel compatible.

12 lines (11 loc) 297 B
/** * Get random integer * @param {number} min - Min value * @param {number} max - Max value * @return {number} - Random integer */ export function rand( min, max ) { min = Math.ceil( min ); max = Math.floor( max ); return Math.floor( Math.random() * ( max - min + 1 ) ) + min; }