Bug on if/else 'ifeven' function


#1


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


error message: "Looks like your function returns false when number = 3. Check whether your code inside the if/else statement correctly returns true if the number it receives is odd."

^the exercise is testing for even numbers. So if the function returns false while the number is 3, the code is correct. the error message seems to indicate a bug in this course.


Replace this line with your code. 
var isEven = function(number) {
  // Your code goes here!
  if ((number%2)===0) {
      return "true";
  }
  else {
      return "false";
  }
};


#2

you return strings, the exercise asked you to return boolean values


#3

It is because you are returning strings, remove the quotes and your gtg. Also you may shorten

to just (number%2), because if this is equal to 0, that also means true


#4

actually, no? zero is considered false and one is considered true? So if you don't check equals zero, you have to swap return true and false


#5

^^^^ What he said, I got switched. Cheers!


#6

i on purpose didn't mention it, because it only adds a degree of difficulty


#7

awesome- deleted the quotations from the return statement. thank you!


#8