Skip to content

Commit 6eec867

Browse files
repharse the sentence and give the code bit for reference
1 parent e76423c commit 6eec867

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎Sprint-2/1-key-exercises/4-random.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
99
// Try logging the value of num and running the program several times to build an idea of what the program is doing
1010

1111
// In this exercise, num represent the value integer number between 1 to 100.
12-
//Math.random generates a random decimal number from 0 up to 1, but not including, 1.
13-
// Round down suppose 14.4 going to 14 as well as 14.9 also down to 14 to the nearest whole number (integer).
12+
//Math.random generates a random decimal number.
13+
//'math.floor'Round down suppose 14.4 going to 14 as well as 14.9 also down to 14 to the nearest whole number (integer).
1414
// i think Changes the whole range to be greater by the minimum value
1515
//Ensures the value never comes less than 1.
1616
//Running the program several times generate the whole number(integer) like (1,10,15,44,66,55) several times between 1 to 100 all 100 number has a equal 1% chance to appear(generate).
17+
// const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;. This step helps to generate the random number and helps to change the decimal number.
1718
console . log (num)
1819
//

0 commit comments

Comments
 (0)