Get Random Int
Get a random integer between min and max (inclusive).
| Category | Random |
| Author | Pol Gubau |
| Since | 1.0.4 |
| Last Updated | 2025-03-17 |
| Type | Sync |
| Compatibility | Universal |
Example
Input
getRandomInt(1, 10)Output:
7
Return
A random integer between min and max.
Type: number
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| min | number | null | No | Minimum value (inclusive). |
| max | number | null | No | Maximum value (inclusive). |
Notes
The function assumes min ≤ max.
Tags
- random
- number
- integer