Created
October 24, 2021 16:40
-
-
Save codergautam/cf56b12e6bce79a89b322df49fa3ba6b to your computer and use it in GitHub Desktop.
A simple js clamp function
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
const clamp = (num, min, max) => Math.min(Math.max(num, min), max); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment