Last active
June 19, 2024 11:48
-
-
Save rodrigograca31/3c6cd8b95b7d7749cac96136211c5d78 to your computer and use it in GitHub Desktop.
Random Integer generator (Typescript)
This file contains 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
/** | |
* Generates a random integer between min and max (inclusive) | |
* @param {number} min | |
* @param {number} max | |
* @returns randomly generated integer | |
*/ | |
public randomInt = (min: number, max: number): number => { | |
return Math.floor(Math.random() * (max - min + 1) + min); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment