0.0.0 • Published 2 years ago
@zzzzbov/clamp v0.0.0
clamp
The clamp
function takes a minimum bound, a value, and a maximum bound and returns the value clamped between the two bounds.
Example
const min = clamp(1, 0, 5); // 1 const value = clamp(1, 3, 5); // 3 const max = clamp(1, 10, 5); // 5
0.0.0
2 years ago