Practice · 1 of 1
Clamp
CHALLENGE
Difficulty: beginner+25 XP
Implement clamp(value, low, high): value if in range, low if below, high if above. One return-statement version exists with the conditional operator — find it if you like.
Press Submit to check your solution.
Back to lesson: Practice: Functions Practice: Contracts