If / else if / else


#1

var isEven = function(number) {
  // Your code goes here!
  
  if(number%2===0){
      return true;
  }else{
      return false;
  }
  else if(isNaN(number)){
      console.log("thats a number");
  }else{
      console.log("thats not a number");
    }
  
};

console.log(isEven(32));

I keep getting an error


#2

the order is always: if, else if and finally else

you can have 0 or more else if's, but you can't have an else if after else


#3

You are also supposed to return statements in this exercise rather than printing them with console.log.


#5

you only need to change is modify console.log to return


#7

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