[Solved] Checking If Number is Even/Odd (Error)


#1


I am stuck on a part for More on Control Flow in JS, since I get a syntax error.


var isEven = function(number) {
  // Your code goes here!
  if (number%2==0){
  return(true)}
  else
  return(false)
}
else
if (isNaN(number)){
    return("Input is not a number")
}

isEven(2)

Replace this line with your code.


#2

lets look at the instructions:

Add an else if branch to your existing if/else statement

did you add else if? No, you added else. Did you add it to your existing if/else branch? You didn't

Please try to fix those issues


#3

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