Created
September 10, 2024 01:52
-
-
Save kyh196201/efc90b9cc08abba4dae223b849d6a17a to your computer and use it in GitHub Desktop.
Apply min max javascript
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 minMax(min, max, value) { | |
if (value < min) return min | |
if (value > max) return max | |
return value | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment