Console printing correctly but the exercise says error!


#1


https://www.codecademy.com/courses/javascript-beginner-en-ASGIv/1/2?curriculum_id=506324b3a7dffd00020bf661#


Hi guys, see my code, the console does correctly say 'Looped Once!' however the exercise keeps giving me the error:

Oops, try again. It looks like you're not printing the right string to the console.


//Remember to make your condition true outside the loop!
var myState = true

var soloLoop = function(){
  while(myState) {
      console.log("Looped Once!");
      myState = false; 
  } 
};

soloLoop();


#2

Have you compared the string that should be printed to what you print? Are they identical? Is it at all possible to tell them apart?


#3

Crikey....I used a capital 'O'...had no idea this had to be that precise!! Been looking at the code for ages haha thanks for the quick reply!


#4

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