benjaminvr

Codecademy - While

Jul 20th, 2021
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const cards = ['diamond', 'spade', 'heart', 'club'];
  2.  
  3. let currentCard;
  4. while(currentCard != 'spade'){
  5.   currentCard = cards[Math.floor(Math.random() * 4)];
  6.   console.log(currentCard);
  7. }
Advertisement
Add Comment
Please, Sign In to add comment