Math.min and Math.max
You’ve probably heard of and used the
One trick that I found particularly handy, is when using both
Math.max together to constrain a number between two bounds.
Something to take-away
We can use ‘currying’ to create a dynamic constraining function that will constrain numbers to the specified bounds.