JS: 6: While Loops

<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

Hi,

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!

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>

```

var cards = [‘Diamond’, ‘Spade’, ‘Heart’, ‘Club’];

var currentCard = ‘Heart’;

while (currentCard !== ‘Spade’) {
console.log(currentCard);

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

currentCard = cards[randomNumber];
}

console.log(‘Found a Spade!’);

<do not remove the three backticks above>

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.

1 Like

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

2 Likes

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