Skip to content

Instantly share code, notes, and snippets.

@philipshen
Created June 16, 2018 14:49
Show Gist options
  • Save philipshen/aea3f737a806294e3f5eeba3efc01106 to your computer and use it in GitHub Desktop.
Save philipshen/aea3f737a806294e3f5eeba3efc01106 to your computer and use it in GitHub Desktop.
export const clamp = (val, min, max) => val < min ? min : val > max ? max : val
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment