We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 74ba574 commit 295a882Copy full SHA for 295a882
Sprint-1/1-key-exercises/4-random.js
@@ -13,5 +13,8 @@ console.log(num);
13
// Math.floor https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor
14
// mdn order of operations javascript https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_precedence
15
16
-
17
-// It generates a random whole number between 1 and 100
+// Math.random() generates a decimal number greater than or equal to 0
+// and less than 1 (0 <= n < 1).
18
+// Multiplying by 100 gives a number from 0 up to (but not including) 100.
19
+// Math.floor() rounds this down to a whole number from 0 to 99.
20
+// Adding 1 shifts the range to 1–100 inclusive.
0 commit comments