[Solved] Short Javascript code snippet involving if / else not being evaluated correctly [closed]


There are two syntax errors in your code:

function isEven(value) {
    //value = Number(value);
if (value%2 == 0) // no parens here is allowed so no syntax error
    return true;
else
    return false;
}


function testCondition() {
                   // ^^ missing parens here

  if (isEven(n)) {
  // ^ ------- ^ -- and here

            } 
  else {

       }
}

solved Short Javascript code snippet involving if / else not being evaluated correctly [closed]