https://github.com/front/math-bound
Set boundaries to a number.
https://github.com/front/math-bound
Last synced: 4 months ago
JSON representation
Set boundaries to a number.
- Host: GitHub
- URL: https://github.com/front/math-bound
- Owner: front
- License: mit
- Created: 2017-11-22T11:48:49.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-22T15:04:16.000Z (over 8 years ago)
- Last Synced: 2025-08-09T10:42:41.179Z (10 months ago)
- Language: JavaScript
- Size: 16.6 KB
- Stars: 0
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Math.bound() & Number.prototype.bound()
Set boundaries to a number. The powers of Math.min() and Math.max() combined!
## Syntax
```
Math.bound(x, min, max)
```
or on a number:
```
x.bound(min, max)
```
## Parameters
- _x_ - a number
- _min_ - minimum value
- _max_ - maximum value
## Install
```
$ npm install math-bound
```
## License
MIT © Frontkom