You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// In this exercise, you will need to work out what num represents?
7
9
// Try breaking down the expression and using documentation to explain what it means
8
10
// It will help to think about the order in which expressions are evaluated
9
11
// Try logging the value of num and running the program several times to build an idea of what the program is doing
12
+
/*
13
+
Firstly its not running as it is showing as undefined as it is lacking something like console.log
14
+
After adding console.log(num) and running it a few times I get 62, 45, 35, 10.
15
+
For what it is doing: Math.floor is the sum of a random number from 0 to 0.9999... which is then multiplied by the maxium - minimun + 1, so 100 - 1 + 1.
16
+
That gives a number from 0-99, then then adds the minimun which is 1, so that gives a random number from 1-100.
0 commit comments