7. The While Loop Exercise


Hello, i am stuck on ‘7. The While Loop’ exercise, i have read the information and get the concept but when it comes to following the instructions it don’t make sense to me and i am not sure what i meant to be doing.

Could someone please give me some advice before i lose all confidence in JavaScript.

Thank you in advance.


Not sure what exercise you are on but since there is a while loop then I’m going to assume there is a condition under which the loop will end.

let currentCard;
while currentCard !== 'heart':
  currentCard = cards[Math.floor(Math.random() * cards.length)]