So i have no problem with the Code itself, but im interested in how this extra code u just have to copy works.

As far as i get it: Of course u need a random number. But Math.random () with empty brackets will only generate a random number between 0 and 1… so it can also be 0.75?? //Thats right???//

therefore u may multiply it with 4. so may get 0.9 * 4 = 3.6

to round it up as an integer u take the “math.floor”. because then the 3.6 will become 4.

//but since the array got Numbers from 0-3 is the 4 not a failure???

also why cant we just put it “math.random(0, 3)” . Couldnt run this to try it out but should that not be possible too?

and finally i dont get how u are able to get this insde the “card=” statement. Why is it inside the Array brackets?

Thanks for ur help in adcance =).

```
let cards = ['Diamond', 'Spade', 'Heart', 'Club'];
let currentCard = 'Heart'
while (currentCard !== 'Spade') {
console.log ( currentCard );
currentCard = cards[Math.floor(Math.random() * 4)];
}
console.log(currentCard);
```