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.
_.clamp(-10, -5, 5);// => -5_.clamp(10, -5, 5);// => 5Clamps `number` within the inclusive `lower` and `upper` bounds. Copy
_.clamp(-10, -5, 5);// => -5_.clamp(10, -5, 5);// => 5Clamps `number` within the inclusive `lower` and `upper` bounds.
_.clamp(-10, -5, 5);// => -5_.clamp(10, -5, 5); Copy
_.clamp(-10, -5, 5);// => -5_.clamp(10, -5, 5);
_.clamp
Clamps
number
within the inclusivelower
andupper
bounds.