If/if else/else



var isEven = function(number) {
var newIseven = number % 2;
if (newIseven===0){
return true;
else if
return "number is incorrect";
return false;

after entering number i get the proper answer except when i enter any string i m not getting the return value "number is incorrect"


when you all the function at the end:


you should actually pas a integer (4 for example) as argument, not even


then whats the use of isNaN function


that is the question, ah yes, you can pass even into the function, but then pass it as string, or define a variable even which holds a string.


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