How do you include the function isNaN?


#1

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

How do I include the function isNaN in this code.

Thanks


function isEven(number) {
  return !(number % 2)
}

isEven(23);


#2

Add an if/else statement in your function. if(isNaN(number)) - return "It's not a number!", else: do what you usually do (you already have it in your code)


#3

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