Help


#1


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

ReferenceError: isEven is not defined
ReferenceError: Invalid left-hand side in assignment


#2

@chipsurfer71401

Change it from =0 to === 0

if(isEven % 2 === 0)

#3

It still not works:

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.


#4

Well, the error says isEven isn't defined. But you defined it with by function. You should be looping and calling that. See below:

var isEven = function(number) {

  if (number % 2 === 0) {
      return true;
      }
else {
    return false;
}
number(10);
};

#5

isEven is the name of your function. number is the word bacasue thats wher te number you input goes


#6

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