View Single Post
Old 12-19-2012, 12:51 PM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,033
Thanks: 197
Thanked 2,410 Times in 2,388 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
if(isEven%2===0){

should be

if(number%2===0){

You are testing whether the number is odd/even, not the function!

It is dangerous to use number as the name of a variable - too easily confused with the Javascript method Number().

Quizmaster: In 1917 King George V changed the name of the British royal house from Saxe-Coburg Gotha to what?
Contestant: Tudor.
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.

Last edited by Philip M; 12-19-2012 at 01:01 PM..
Philip M is offline   Reply With Quote
Users who have thanked Philip M for this post:
Entity_ (12-19-2012)