1. if/else


#1


More on Control Flow if/else, lesson 1..


I'm receiving an error that should mean the code is functioning correctly based upon the lesson instructions??

Oops, try again. Looks like your function returns false when number = 3. Check whether your code inside the if/else statement correctly returns true if the number it receives is odd.


Replace this line with your code. 

// Write your code below!

var isEven = function(number) {
  if (isEven%2)
  {
    return "true"
  }
    else
    {
    return "false"    
    }
  
};


#3

Your function is also ignoring its argument - so there's no way it'll be able to tell even apart from odd, because it's not looking at the number


#4

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