If / else if / else


Hey.. can enyone explain me, why my code doesn't work?

var isEven = function(number) {
if(number%2 === 0) {return "Number is divisibly by 2";}
else if(isNaN(number))
{ return "It's not a number!";}
else {return "Number is not divisible by 2";}
// Your code goes here!


I always get this one: "Oops, try again. Your function returns true for 3!"

thanks for your help!


because you should return boolean values if the number is divisible by 2 return true, if not, return false


omg.. I didn't know I am that stupid ..:confused:
thank You!!


It should be in the instructions, go look and see if you can find it


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