Update clampNumber.md

This commit is contained in:
Angelos Chalaris
2017-12-21 11:08:01 +02:00
committed by GitHub
parent de50467307
commit bb135f6048

View File

@ -2,7 +2,9 @@
Clamps `num` within the inclusive `lower` and `upper` bounds.
If `lower` is greater than `upper`, swap them. If `num` falls within the range, return `num`. Otherwise return the nearest number in the range.
If `lower` is greater than `upper`, swap them.
If `num` falls within the range, return `num`.
Otherwise return the nearest number in the range.
```js
const clampNumber = (num, lower, upper) => {