Invalid syntax error


#1


I am trying to do the Javascript course, Introduction to Objects 2, exercise 27.


I am getting the error message "SyntaxError: missing ) after condition". There is only one If statement and the condition does have a right paren. I tried just moving to the next exercise, but I get a bad error message there also. I also tried a different browser but also get error there.


// print hello in the 3 different languages
for (var x in languages) {
    if (typeOf languages[x] === 'string') {
        console.log(languages[x]);
    };
};


#2

typeOf //should be typeof

remember javascript is case-sensetive


#3

Thanks--can't believe I didn't get that one. For some reason, I was convinced that it was typeOf--probably because "camel" naming is so prevalent in Javascript.


#4

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