Created
December 1, 2021 14:29
-
-
Save smitroshin/4bd01cdc04f446a5bd8ed95f93b40c9d to your computer and use it in GitHub Desktop.
Generate Random Whole Numbers within a Range
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
/** | |
* Generate Random Whole Numbers within a Range | |
* | |
* Source: https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/generate-random-whole-numbers-within-a-range | |
* | |
* @param {number} min | |
* @param {number} max | |
*/ | |
const randomRange(min, max) => 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