JS: 6: While Loops



On 6: While Loops, I asked the system to provide the answer for me (code can be seen below). Even after having the answer already populated in the code editor, the system still gives me an error! This means codecademy disagrees with itself?
Not sure how to move forward from here.

This is a screen shot: http://imgur.com/a/yxFj4
I would love some help, thank you!

var cards = ['Diamond', 'Spade', 'Heart', 'Club'];

var currentCard = 'Heart';

while (currentCard !== 'Spade') {

  var randomNumber = Math.floor(Math.random() * 4);

  currentCard = cards[randomNumber];

console.log('Found a Spade!');


Which exercise are you on? If you have more code than the checkpoint is looking for then it can't sort that out. Yes, this is a problem. :slight_smile: You should report your experience by using the exercise's built in bug reporting tool.


I tried erasing some of the answer, to no avail. I also reported it in the bug report. Thanks!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.