Last active
October 24, 2021 15:38
-
-
Save codergautam/81ca397fc18f5b2386ea7732b9b722e1 to your computer and use it in GitHub Desktop.
A simple function to get a random integer from a range in JavaScript.
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
const getRandomInt = (min, max) => min + Math.floor(Math.random() * (max - min + 1)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment