Is it okay to mess with the format?


var isEven = function(number) {
if isNaN(number){
return "Look, and believe me when I say this, whatever that thing you put into the function is you need to take it into the back alley and smother it with a pillow. I'd also recommend doing the same to yourself."
else if (number % 2 ===0){
return true
return false

It's not registering even though I'm pretty sure it makes perfect sense.


What is isNan? You made isEven a variable, but you're using isNan in its place? Also, maybe I'm mistaken, but shouldn't there be some sort of requirements for the if section? Without knowing what isNan does, I assume inputting any number would technically trigger the entire statement at the same time. There's probably more, but I don't dabble in Javascript often.


@arraysurfer21398 as @eternallocket already mentioned your problem is probably the missing () for your if statement:

if (isNaN(number)){

isNaN is a built-in function that checks if whether the stuff inside it's () is NaN ( Not a Number) or not and which returns true if it is NaN and false if it is not.