9.1 More on Control Flow, if/else


I'm not sure why, but it keeps telling me: Oops, try again. 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.

my code is
var isEven = function(number) {
// Your code goes here!
return 'True'
return 'False'

Can someone please explain what I'm doinig wrong?


The reason your getting that error is because you're returning 'True' in single quotes. That makes true a string. You want to change that to a Boolean by taking the quotes out.


Also use true and false with lower case starting letters as this is javaScript not Python :wink:


Thank you, I feel stupid now :smile: