Created
June 1, 2015 02:59
-
-
Save mattlundstrom/95c2990d9f236ece0ebe to your computer and use it in GitHub Desktop.
clamp
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 clamp( value, min, max ){ | |
return Math.min( Math.max( value, min ), max ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment