export function clamp(value: number, min: number, max: number): number { return }
That is just adding an extra jump and entry on the callstack where you could just have done:
Math.min(Math.max(value, min), max);
Where you need it.
(The example used was probably just for illustration though)
i disagree with this particular example - it's actually a good use case for being a utility maths function in a library.
I mean, the very `min()` and `max()` function you used in the illustration could also have been used as an example, if you use the same logic!
Are there 1000 people running 100 CI pipelines/day where downloads aren’t cached?
01HNNWZ0MV43FF•44m ago
ants_everywhere•33m ago