Intermediate
Ruby
Q73 / 100
What does "Comparable#clamp(min, max)" do?
Correct! Well done.
Incorrect.
The correct answer is B) Returns the value constrained to lie within [min, max], returning min or max if the value falls outside the range
B
Correct Answer
Returns the value constrained to lie within [min, max], returning min or max if the value falls outside the range
Explanation
clamp restricts a value to a given range, returning the boundary value if the original value is below the minimum or above the maximum.
Progress
73/100