Where is the wrong code?


#1

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 "Is Even Number"
  }
  else if (isNaN(number))
  {
      return "Not a Number"
  }
  else
  {
      return "Is Odd Number"
  }
};

isEven("k");


#2

You are returning the strings "Is Even/Odd Number" rather than true or false.


#3

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