The number to clamp.
Optional
lower: numberThe lower bound.
The upper bound.
Returns the clamped number.
_.clamp(-10, -5, 5);
// => -5
_.clamp(10, -5, 5);
// => 5
Clamps `number` within the inclusive `lower` and `upper` bounds.
_.clamp(-10, -5, 5);
// => -5
_.clamp(10, -5, 5);
_.clamp
Generated using TypeDoc
Clamps
number
within the inclusivelower
andupper
bounds.