View Single Post
Old 12-19-2012, 12:10 PM   PM User | #1
Entity_
New Coder

 
Join Date: Dec 2012
Location: Ingerlund
Posts: 62
Thanks: 8
Thanked 4 Times in 4 Posts
Entity_ is an unknown quantity at this point
Simple statement to find it number is odd or even

Here it is:

Code:
var isEven = function(number) {
  if(isEven%2===0){
  	return true;
  	
  }else{
  	return false
  }
};

isEven(2);

This seems to return false, but I have no idea why. AFAIK if you put in an even number, it should hit the if statement, come up with no remainder and so return true! Sadly it returns false every time. I know this is very simple stuff guys but please don't make fun of me I learn better when I can ask stupid questions and you only have to ask them once!
Entity_ is offline   Reply With Quote