Comment Comment by amichal 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. parent amichal 6 years ago
Math.max(lower_bound, Math.min(num, upper_bound))
Since i read right to left.