Profile
Sign out
menu
create
New Post
My learned
Sign In
Clamp
Ruby
We can use the following method to ensure a variable value is between a specific range
# Ensure between 1 and 100 111.clamp(1, 100) # => 100 -1.clamp(1, 100)
arrow_back
back