Function returns false when number = 3


#1



Control Flow If/ else


I get an error that the function returns false when number = 3, I tried switching the true and false conditions to test and get the same error?


var vNum = prompt("Pick a number: ");

var isEven = function(number) {
  // Your code goes here!
  if(vNum%2 === 0){
      return true;
  }else{
      return false;
  }
  
};

isEven(vNum);


#2

Hi here

if(vNum%2 === 0)

You should not put vNum but number since it is the argument of your function isEven.


#3

I thought when I called the function and passed it vNum that was correct? Also it says 'number is not defined' so I'm unsure as to where to go from here, thanks for your reply, maybe this is a good time to do some of that "research" stuff I've been hearing good things about :wink:

EDIT - Nevermind, it helps if I spell "number" correctly. Thanks Wizmarco!