What is wrong with my code? 9/2 If / else if / else


Hi! I have looked at the code, and cannot find my mistake. Any help will be much appreciated!

Here is the link:

Here is the error message I receive:
Oops, try again. Your function returns true for 3!

Here is my code:

var isEven = function(number) {
  if ((number % 2) === 0) {
      return "true"
  } else if (isNaN(number)) {
      return "You did not enter a valid number."
  } else {
      return "false"



if you use false or true, there are no " " needed!

You need to change in your code return "false" or return "true" to return false or return true.


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