Comparison Operators #3


#1


https://www.codecademy.com/courses/learn-javascript/lessons/control-flow/exercises/comparison-operators?action=lesson_resume&link_content_target=interstitial_lesson

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.


#2

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


#3

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


#4

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