Created
July 27, 2020 05:30
-
-
Save intelguasoft/638153ae21b3f480061a06e1912fccdd to your computer and use it in GitHub Desktop.
Random Integer generator (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
/** | |
* 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