More on Control Flow in JS (2)


#1


Hello, I would like some help solving this problem. I can't see what I am doing wrong!


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


Oops, try again. Your function returns true for 3!


var isEven = function(number) {
  // Your code goes here!
  
     if( number % 2 === 0 ){
         
      return "it's true";
      
      }
      
      else if( number === isNaN ){
          
          return "the input is not a number";
        }
        

     else{
          return "it's not true";
        }
  
};

isEven(3);


#2

you should return Boolean values (true and false) for even and odd numbers, not strings

You use isNaN wrong


#3

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