If/else if/else unexpected token



I am currently receiving a SyntaxError: Invalid or unexpected token. In the example, isNaN is highlighted in orange, however once entered in the code, isNaN is highlighted red. Is this the cause of the error?

var isEven = function(number) {
  // Your code goes here!
if (number % 2 === 0) {
    return true;
else if (isNaN(isEven)) {
    return "not valid";
else {
    return false;


The problem is your elif statement as you assumed.

Here you are supposed to be checking if the number argument is true nit the function itself. :slight_smile:

S you'd write it like,

else if (isNaN(number) === true)


help me out


your elsif should check for true not false. :grin:


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