2. If / else if / else


#1


Hi not sure what I'm doing wrong...
It has the error 'ReferenceError: isNan is not defined'

https://www.codecademy.com/courses/javascript-beginner-en-qDwp0/0/2?curriculum_id=506324b3a7dffd00020bf661#

var isEven = function(number) {
  if(number % 2 === 0){
    return true
  } else if(isNan(number)) {
      return "This isn't a number"
  } else {
     return false
  }
}
isEven(6)


#2

instead of: isNan, It should be: isNaN


#3

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