2.if/else if/else printing



Hey guys, I passed the lesson, but my return function isnt printing to the console. What can I do to fix this?

var isEven = function(number) 
if (number%2 === 1){
return true;

}else if (isNaN(number)){ 
    return ("Not a number");

 } else {
return false;
isEven = "cowwww"



if (number%2 === 1)

To check if a number is even or not , The modulo should give 0.
Thus conditional comparison statement would be
number%2 == 0

isEven = "cowwww"
isEven(number) is a function that takes anything as argument inside the bracket.
like this

so we don't equate but put argument inside the brackets!


Awesome! Thanks a ton!


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