Skip to content

VictorioBerra/clamp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clamp frozen

Clamp a value between two other values. It's as simple as modules come - saving keystrokes because I've had to write this function too many times.

Usage

clamp

clamp(value, a, b)

Returns value, if it is between a and b. Otherwise, returns the number it's gone past.

License

MIT. See LICENSE.md for details.

About

Clamp a value between two other values.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%