Return a value that is clamped between two inclusive bounds.
returns value if within bounds, otherwise the closest bound
value
clamp(10, 3, 12) === 10clamp(1, 3, 12) === 3clamp(20, 3, 12) === 12
the value to clamp
the minimum bound
the maximum bound
Generated using TypeDoc
Return a value that is clamped between two inclusive bounds.
Returns
returns
value
if within bounds, otherwise the closest boundExample