If/Else/Else if


I don't understand the mistake in this exercise. The function part of the program was pre-written. Is my code wrong?

Thanks in advance!


a single equal sign means assign, not check if things are equal


you can put two 'equals to' in your 'if statement'

  if (number%2 == 0) {
      return true;


best practice is to always use ===

also @dhanyasreepremsankar conditions always evaluate to true or false

function myFn(n){
 return (n%2 === 0)



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