Part 11: AND


The console shows " Oh i see; Oh i see; A hungry man is an angry man!"
What am i doing that causes it to do that? So far what i want to happen is to just print "a hungry man is an angry man!"

// Declare your variables here!
var hungry=true
var foodHere=true

var eat = function() {
  // Add your if/else statement here!
  if(hungry && foodHere){
    console.log("A hungry man is an angry man!")
    return true
    console.log("Oh i see")
    return false


If you want to something specific to print to the console, call your eat function or use a console.log statement to call the eat function.


ok so to get it to just say "a hungry man is an angry man!", basically, call the function, alrighty

but what makes it print "oh i see; oh i see; a hungry man is an angry man!" ?


I think it has something to do with the console display codecademy uses. I've read on the forums that it repeats the last line of code. Have you ever noticed that it displays the word 'false' sometimes even if you haven't logged anything to the console?

On, your code displays nothing:

On jsbin:,console


Your missing semicolons?.


oh ok... But semicolons do not cause these sort of things
this is because semicolons are they to tell the console to continue running the code in a way


What are you trying to do exactly?


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