There was an error while loading. Please reload this page.
1 parent 896bdbc commit 60d1f16Copy full SHA for 60d1f16
1 file changed
Sprint-2/1-key-exercises/4-random.js
@@ -9,7 +9,7 @@ const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
9
// Try logging the value of num and running the program several times to build an idea of what the program is doing
10
console.log(num);
11
// num is a random whole number between minimum and maximum.
12
-// Math.random() gives a decimal between 0 and 1.
+// Math.random() returns a number that's greater than or equal to 0 and less than 1.
13
// Then we multiply by (maximum - minimum + 1) to get a range of possible values.
14
// Math.floor(...) turns that into a whole number.
15
// Finally, we add minimum so the number starts at minimum instead of 0.
0 commit comments