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 73c30ee commit 21eed1bCopy full SHA for 21eed1b
1 file changed
Sprint-1/1-key-exercises/4-random.js
@@ -4,10 +4,10 @@ const maximum = 100;
4
const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
5
console.log(num);
6
// In this exercise, you will need to work out what num represents?
7
-// num represents random whole number between 1 to 100
+// num represents random whole number in the interval [1,100]
8
//It is generated by:
9
-//Creating a random decimal between 0 and 1 using Math.random()
10
-//Scaling it to the range 1 to 100
+//Creating a random decimal in the interval[0'1)] using Math.random()
+//Scaling it to in the interval [1,100]
11
//Rounding it down using Math.floor() so it becomes an integer
12
13
// Try breaking down the expression and using documentation to explain what it means
0 commit comments