PDA

View Full Version : Distinguishing # types


fivepointer
12-18-2006, 01:01 PM
How do you distinguish between numbers that are add and even in javascript? i searched a whole jscript book and web for it but couldn't find any info.

hrethan
12-28-2006, 04:08 PM
I assume you mean odd and even. Check out the modulus operator %. You should be able to do something like $number % 2 == 0 (if true, even, if not, false). HTH.