If/Else Issue


#1


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


I obtain this everytime: "Oops, try again. Looks like your function returns false when number = 2. Check whether your code inside the if/else statement correctly returns true if the number it receives is even."


var isEven = function(number) 
{
    if (number % 2)
    {
        return true;
    }
    else
    {
        return false;
    }
};


#2

hi
try
if (number % 2 === 0 )


#3

IT WORKED! Thank you so very much!


#4

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