More on control flow error message


#1


https://www.codecademy.com/courses/javascript-beginner-en-qDwp0/0/1?curriculum_id=506324b3a7dffd00020bf661#


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


Replace this line with your code. 

var isEven = function(number) {
  // Your code goes here!
  if(isEven%2 === 0){
      return true;
  }else{
      return false;
  }
 
  
};


#2

You are comparing whether the function, i.e. isEven, is even, what you need to be doing is comparing if the input, in this case "number", is even.


#3

This worked! Thank you.

var isEven = function(number) {
// Your code goes here!
if(number%2 === 0){
return true;
}else{
return false;
}

};


#4

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