Returns a random integer between min and max values.
- Source:
Methods
(static) getRandomInteger(minopt, maxopt) → {number}
- Source:
Example
import { getRandomInteger } from '@untemps/utils/number/getRandomInteger'
const min = 0
const max = 100
getRandomInteger(min, max) // 42
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
min |
number |
<optional> |
-Number.MAX_SAFE_INTEGER
|
The minimum value to pick. |
max |
number |
<optional> |
Number.MAX_SAFE_INTEGER
|
The maximum value to pick. |
Returns:
A random integer between min and max.
- Type
- number