Testing for validity

Posted by Konrad on Stack Overflow See other posts from Stack Overflow or by Konrad
Published on 2010-05-24T11:49:15Z Indexed on 2010/05/24 12:01 UTC
Read the original article Hit count: 223

Filed under:

Hi,

I'd like to know the difference (if any) between the following:

if( someDOMElement.someProperty )
{
...

if( someDOMElement.someProperty != null )
{
...

if( someDOMElement.someProperty != undefined )
{
...

Is one safer than the others?

© Stack Overflow or respective owner

Related posts about JavaScript