Control flow 5/11 help!


#1

Can someone help?

I’m pretty sure I got the code right but it gives me an error and I can’t progress.

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

this is the error:

U2L1E4/main.js:5
} else }
^
SyntaxError: Unexpected token }
at createScript (vm.js:53:10)
at Object.runInThisContext (vm.js:95:10)
at Module._compile (module.js:543:28)
at Object.Module._extensions…js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:427:7)
at startup (bootstrap_node.js:151:9)

here’s my code:

let hungerLevel = 5;

if (hungerLevel > 7){
console.log(‘Time to eat!’);
} else }
console.log(‘We can eat later!’);

}






#2

Hi @slinkyfran,

Do have a look of what comes after the else in your code.

You have one closing curly bracket } whereby it should be an opening curly bracket { instead.

Cheers :slight_smile:


#3

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