Created
February 25, 2019 21:33
-
-
Save okovalov/4122c7bf8d42575580280a09a71edd56 to your computer and use it in GitHub Desktop.
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
/** | |
* A random integer between given min and max | |
*/ | |
const getRandomNumber = (min = 1, max = 10) => Math.floor(Math.random() * (max - min + 1)) + min | |
const min = 10 | |
const max = 15 | |
for (let i = 1; i <= 10; i++) { | |
console.log(`Random number between ${min} and ${max} = ${getRandomNumber(min, max)}`) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment