Clamps number within the inclusive lower and upper bounds.
number
lower
upper
The number to clamp.
Optional
The lower bound.
The upper bound.
Returns the clamped number.
5.7.0
clamp(-10, -5, 5)// => -5clamp(10, -5, 5)// => 5 Copy
clamp(-10, -5, 5)// => -5clamp(10, -5, 5)// => 5
Clamps
number
within the inclusivelower
andupper
bounds.