clamp

Number
since 4.0.0

Returns

number the clamped number.

Clamps number within the inclusive lower and upper bounds.

Example of Lodash _.clamp

_.clamp(-10, -5, 5);
// => -5

_.clamp(10, -5, 5);
// => 5