If/ else if/ else ReferenceError


#1

Everytime I press save&submit Code an error show`s up in the console saying
ReferenceError: Left side of assignment is not a reference.
"true"
Here is my Code:
var isEven = function(number) {
// Your code goes here!
if (number % 2 === 0){
return "true";
}
else if (isNaN(number)=true){
return "Your input is no number. Please change your input to a number";
}
else {
return "false";
}
};
isEven (4)


#2

return true; (instead of return "true").
same goes to return false.

I think it should work that way


#3

This did`T work.
I deleted the = true in the else if condition and it worked
But thank you for your very fast answer :slight_smile:


#4

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