4 ms·
Assuming we know (lower_bound <= upper_bound) I'd write: Math.max(lower_bound, Math.min(num, upper_bound)) Since i read right to left.
by amichal 6y ago
Assuming we know (lower_bound <= upper_bound) I'd write:
Math.max(lower_bound, Math.min(num, upper_bound))
Since i read right to left.
- biddlesby 6y agoIt’s amazing what a difference it makes when you just good names and formatting