Skip to content

Commit cecb6ba

Browse files
committed
added a "for" statement, for random number generation to log multiple values in a loop
1 parent dce53b5 commit cecb6ba

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
const minimum = 1;
22
const maximum = 100;
33

4-
const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
4+
for (let i = 0; i < 5; i++) {
5+
const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
6+
console.log(num);
7+
}
58

69
// In this exercise, you will need to work out what num represents?
710
// Try breaking down the expression and using documentation to explain what it means

0 commit comments

Comments
 (0)