11. Review unexpected token ; and expected opening {


#1


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


SyntaxError: Unexpected token ';'. Expected an opening '{' at the start of a function body.


  for (var i=1; i<11; i++){
        console.log(i);
    }
   var misha = function ();
while (misha === true) {
    console.log("Misha");
    misha = false;
    }
    var loopCondition = false;
    do{
       
        console.log("phrase" + loopCondition +"!");
    }
    while(loopCondition);


#2

Check my comment, that's the reason for the error message. I don't recommend using misha as the name of your function and the boolean being checked in the while loop condition of the same function. Things get messy. Also, don't forget to close the function.


#3

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