Help! stuck on: more control flow in js 11. and!


Whenever i submit the code it says "Did you declare a variable called hungry?"

var foodHere = true;
var hungry = true;

var eat = function() {
    if(hungry && foodHere = true) {
   console.log("Ok dig in!");


This part you can write just as

if(hungry && foodHere){ 
//some code

Because both are set value to true so the if is checking
if(true && true) which is true. No need for = true


Thanks it worked! :smiley:


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