8/11 syntax error: exected ';'


#1

I've been stuck on this for/while loop for way too long and I can't seem to find any other posts with the same syntax error in regard to 8/11.

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

SyntaxError: Expected ';'


var george === true;

var clooney = function(){
    while(george === true){
        console.log("George Clooney is a pretty good actor!");
        george === false;
    }
}

clooney();

var count = function(){
    for(var i = 0; i < 5; i++){
        console.log("I can count to" + "" + i);
    }
};
 count();


#2

You're missing a semicolon


#3

I added the ";" where you suggested and I still receive the same error. Thanks for the help though!


#4

You have wrong numbers of = signs


#5

Thank you that ended up fixing it, but why does it make a difference. I know that when you only have one = it's assigning and if you have == or === it sets it equal to. I also don't understand why the "George in the while statement doesn't have to be just =. I appreciate all the help you have given me!


#6

When you're assigning a value to a variable you use =. You're saying to the coputer this variable now contains this value, but when you use === you're making a comparison, you're asking the computer if the variable contains a value that is equal to the other value. I hope my explenation is comprehensive enough.


#7

Yes that makes a lot more sense, I appreciate all the help.


#8

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