Skip to content

Commit 82eeb81

Browse files
committed
4-random done
1 parent 2af0341 commit 82eeb81

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ const minimum = 1;
22
const maximum = 100;
33

44
const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
5+
console.log(num)
56

67
// In this exercise, you will need to work out what num represents?
78
// Try breaking down the expression and using documentation to explain what it means
89
// It will help to think about the order in which expressions are evaluated
910
// Try logging the value of num and running the program several times to build an idea of what the program is doing
11+
//results: 4,23,91,46 the program is giving you a random number while math.random give you a random decimal number math.floor rounds the total number up

0 commit comments

Comments
 (0)