Clamps a number between a minimum and maximum value.
The number to clamp.
The lower boundary.
The upper boundary.
The clamped number.
clamp(5, 1, 10); // 5clamp(-5, 0, 100); // 0 Copy
clamp(5, 1, 10); // 5clamp(-5, 0, 100); // 0
Clamps a number between a minimum and maximum value.