1. If / else


#1


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


It says my code returns false when the parameter "number" = 3 Any help?


var isEven = function(number) {
  // Your code goes here!
  if (number % 2 === 0) {
      return "true";
  }
  else {
      return "false";
  }
};
//Line 10
isEven(3);


#2

"true" and "false" are strings. You need to remove the quotes to use the keywords true and false, that indicate a boolean value.


#3

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