clamp
Public Function
Clamp a value into a range.
Example
const A = clamp(0, 1, 10) // 1
const B = clamp(11, 1, 10) // 10
const C = clamp(5, 1, 10) // 5
Parameters
| Name | Description |
|---|---|
| The number to clamp. |
| The minimum value. |
| The maximum value. |
Returns
number