Comparison Operators #3


var hungerLevel = 5;
if (hungerLevel >7 ); {
console.log('Time to eat!');
} else {
console.log('Let\'s eat later.');

The error messages I am getting indicate that my fourth line of text is wrong. The messages read:
"Expected an identifier and instead saw 'else'." and
"Expected an assignment or function call and instead saw an expression."

What am I missing??

Replace this line with your code.


Putting a semicolon there is ending your if statement at that point.


AH!!! That fixed it. Thanks, Albionsrefuge!!


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