File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
77// That is because of the value of the minimum is 1.
88//2.lets start by (maximum-minimum +1) which the output is 100.
99//3.math.random()*100 returns random number between 0 and 100, what actually
10- // happens is that math.randum gives out random number from 0 to 1 which 1 is
10+ // happens is that math.random gives out random number from 0 to 1 which 1 is
1111// not included and in this case, multiply the output by 100.
12- //4.math.floor() gives out the largest intiger which is less than or equal to
13- // the given number,which is decimal, which means it drops all the decimal. forexample if
12+ //4.math.floor() gives out the largest integer which is less than or equal to
13+ // the given number,which is decimal, which means it drops all the decimal. for example if
1414// the output is 69.5, it compares 69 with 69.5.The output will be 69 which is the largest Integer.
1515//5.at the end we add 1 which is the minimum.
1616console . log ( num ) ;
You can’t perform that action at this time.
0 commit comments