Earlier, I mentioned that you never need new Boolean to create a boolean value. That's because Javascript rarely needs boolean values at all; it will gladly make boolean decisions based on any type of variable--numbers, strings, even objects! When used in a context that needs a boolean value, Javascript considers these values--and only these values--to be false : false (the boolean kind) 0 (numeric zero) null (the null value) undefined (the undefined value) NaN (the not-a-number value) "" (an empty string) Anything else is considered to be a true value. Anything. Really. Memorize the entire set of potentially false values, it will make your Javascript better. Be careful, Javascript will not automagically convert values from another type when it evaluates their booleanosity. String values of "0" , "false" , or "null" evaluate to true . In contrast, an expression like parseInt("0") returns numeric zero and evaluat
Tomorrow speak what tomorrow thinks in hard words again, though it may contradict everything you said today. -- Emerson