clamp function
This commit is contained in:
parent
8c93e578a0
commit
9971867e2f
1 changed files with 2 additions and 0 deletions
|
|
@ -213,3 +213,5 @@ export const splitAt = function (index, value) {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const zipWith = (f, xs, ys) => xs.map((n, i) => f(n, ys[i]));
|
export const zipWith = (f, xs, ys) => xs.map((n, i) => f(n, ys[i]));
|
||||||
|
|
||||||
|
export const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue