Created
December 22, 2021 11:47
-
-
Save js2me/05d60e9d65719c995fdb855deed5a7ba to your computer and use it in GitHub Desktop.
clamp algorithm on typescript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const clamp = (num: number, min: number, max: number): number => | |
Math.max(min, Math.min(max, num)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment