clamp function

This commit is contained in:
Felix Roos 2023-05-28 12:41:53 +02:00
parent 8c93e578a0
commit 9971867e2f

View File

@ -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 clamp = (num, min, max) => Math.min(Math.max(num, min), max);