Created
May 6, 2014 13:36
-
-
Save paul-bjorkstrand/0e3008a7d7d772d4f16b to your computer and use it in GitHub Desktop.
Simple min-max, bounding a value between a minimum and maximum
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!Math.minMax) { | |
Math.minMax = function(min, max, val) { | |
return Math.max(min, Math.min(max, val)); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment