There was an error while loading. Please reload this page.
1 parent 6f5e1ca commit e9d4ba3Copy full SHA for e9d4ba3
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
11
// 1. num is a variable that stores the final result of the expression assigned to it.
12
-// 2. The Math.random() method generates a random decimal number from 0 up but not excluding 1.
+// 2. The Math.random() method returns a pseudo-random floating number between 0(inclusive) and 1(exclusive).
13
// 3. The Math.floor() method round a decimal number down to a whole number.
14
// 4. (maximum - minimum + 1) calculates how many possible whole numbers there are.
15
// Java Script evaluates the expressions inside the inner parentheses first.
0 commit comments