2/14 If / else if / else


What is wrong with my code? Please, help out. Thank you very much!


Oops, try again. Your function returns true for 3!

var isEven = function(number){
    if (number%2 === 0){
    return "This is an even number, good job."
        else if (isNaN(isEven)) {
        return "This is not a number."
    return "This is not an even number"

var num = prompt("Type a number!");


"What is wrong" is super unspecific. Have you read the error message? What is preventing you from acting on what it says?


You cant take your function as a condition


IsNaN (number){return "Something";}


thats the problem. You did read about a function called isNan but we dont have sucha function in the code so in the semicolon you should have the name of your function(isEven(number)===true).


I think you have to put quotations around....isNaN("isEven"). isNaN is checking if whatever is in the bracket is a string or not. anything between quotations, is considered a string. Because you have isEven, which is the function itself, it's not going to work