File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
55console . log ( num ) ;
66
77
8- // num variable that carries the result of the expressions evaluated.
9- // (maximum - minimum) does basic math : 100 - 1 + 1 = 100
10- // Math.floor() takes out all decimal and make them an integer .
11- // Math.random() gives random numbers between 0 and 100 .
12- // + minimum add 1 at the end but randomise to the value between 0 and 100
8+ // " num" variable carries the result/value of the expressions evaluated.
9+ // (maximum - minimum) workout the size of the range : 100 - 1 + 1 = 100
10+ // Math.floor() takes out all decimal and make them a whole number from 0 to 99 .
11+ // Math.random() gives a decimal from 0 up to just under 1 (0.9999999) .
12+ // + minimum add 1 to the expression at the end because it is decleared a variable.
You can’t perform that action at this time.
0 commit comments