Why won't this work?



-Oops, try again. It looks like you have a ReferenceError. Maybe you forgot to define a function named isEven?
-ReferenceError: isEven is not defined
-ReferenceError: Invalid left-hand side in assignment

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


if(number % 2 = 0)

You need to add another equal sign here making it look like this.

if(number % 2 == 0)

This is because you are comparing rather than assigning.

Let me know if that worked and if you need further explanation.


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