Skip to content

Instantly share code, notes, and snippets.

@electerious
Created November 13, 2015 10:45
Show Gist options
  • Save electerious/0410242d781e922a378d to your computer and use it in GitHub Desktop.
Save electerious/0410242d781e922a378d to your computer and use it in GitHub Desktop.
Limit a number between a min and max value
const limit = (min, max, num) => Math.min(Math.max(num, min), max)
@electerious
Copy link
Author

Moved to limit-number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment