Created
November 17, 2014 21:43
-
-
Save c-kick/1dfcdc91334a7de3a7af to your computer and use it in GitHub Desktop.
Limit integer to a min and max
This file contains 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
function valBetween($val, $min, $max) { | |
return (Math.min($max, Math.max($min, $val))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment