There was an error while loading. Please reload this page.
1 parent b2957b1 commit c7309cfCopy full SHA for c7309cf
1 file changed
Sprint-2/1-key-exercises/4-random.js
@@ -2,11 +2,14 @@ const minimum = 1;
2
const maximum = 100;
3
4
const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
5
-
+console.log(num);
6
7
// In this exercise, you will need to work out what num represents?
8
// Try breaking down the expression and using documentation to explain what it means
9
// It will help to think about the order in which expressions are evaluated
10
// Try logging the value of num and running the program several times to build an idea of what the program is doing
11
12
-//num represents a random whole number between 1 and 100.
+// Math.floor() rounds down to a whole number instead of rounding up
13
+// Math.random() gives a random decimal
14
+
15
+//num represents a random whole number between 1 and 100.
0 commit comments