JavaScript while Loops error

var cards = [‘Diamond’,‘Spade’,‘Heart’, ‘Club’];
var currentCard = ‘Heart’;
while (currentCard !== ‘Spade’) {
var randomNumner = Math.floor(Math.random() * 4);
currentCard = cards[randomNumber];
console.log(‘Found a Spade!’);

Above is the code that I wrote. Now I am getting check marks as if it is right but I am getting an error message in the console, randomNumber is not defined. I know there is something wrong but I don’t know how to fix it.

Thank you for any help,

check your spelling, you made a typo in a variable name

Thank you so much. I feel so silly now.

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