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 f2de098 commit 3e9c48cCopy full SHA for 3e9c48c
1 file changed
Sprint-1/1-key-exercises/4-random.js
@@ -7,3 +7,19 @@ const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
7
// Try breaking down the expression and using documentation to explain what it means
8
// It will help to think about the order in which expressions are evaluated
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
12
+/*
13
14
+In this exercise, num is a variable that stores the random whole number generated by the expression so it can be used later in the program.
15
16
+1. Math.randon() picks a random decimal number
17
18
+2. maximum - minimum + 1; finds how many numbers are in the range
19
20
+3. Math.floor() rounds the decimal down
21
22
+4. +minimum adds the minimum value
23
24
25
+*/
0 commit comments