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 b25d953 commit 2e44be5Copy full SHA for 2e44be5
Sprint-1/1-key-exercises/4-random.js
@@ -2,6 +2,11 @@ const minimum = 1;
2
const maximum = 100;
3
4
const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
5
+// num is an integer between minimum and maximum, between 1 and 100 inclusive
6
+// math.random() produces a decimal between 0 (inclusive) and 1 (exclusive)
7
+// math.floor() rounds down to the nearest integer
8
+// (maximum - minimum + 1)) + minimum chooses a number between minimum and maximum and adds 1 so its inclusive of maximum
9
+console.log(num);
10
11
// In this exercise, you will need to work out what num represents?
12
// Try breaking down the expression and using documentation to explain what it means
0 commit comments