Unexpected token { in my If/Elseif/if statement


#1


I have followed every little detail in the instructions but it keeps telling me there is an unexpected token { and I have tried adding and removing from my code, I don't know where I lost what I was doing...

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


#2

HI the else if statement should have the condition

if (condition) {

}
else if (condition) {

}
else {

}

then you should put this Not a real number around " "


#3

It is giving me unexpected identifier now that I have changed it.


var isEven = function(number) {
if(isNaN(number)){
return(true);
}
else if(isEven %=2){
return(false);
}
else{
return(Not a real number);
}
};



#4

Never mind I didn't do that last bit that you told me to do, I just fixed it. Thanks so much for your help!


#5

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