1. if/else


More on Control Flow if/else, lesson 1..

I'm receiving an error that should mean the code is functioning correctly based upon the lesson instructions??

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.

Replace this line with your code. 

// Write your code below!

var isEven = function(number) {
  if (isEven%2)
    return "true"
    return "false"    


Your function is also ignoring its argument - so there's no way it'll be able to tell even apart from odd, because it's not looking at the number


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