Skip to content

Instantly share code, notes, and snippets.

@renet
Created November 20, 2020 12:44
Show Gist options
  • Save renet/b388da0c866d1954fc8cf0b372e1fe94 to your computer and use it in GitHub Desktop.
Save renet/b388da0c866d1954fc8cf0b372e1fe94 to your computer and use it in GitHub Desktop.
Limit a number between a min and a max range
Math.between = (value, min, max) => Math.max(Math.min(value, max), min);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment