[thelist] Re: Javascript empty array question

Peter-Paul Koch thelist at lists.evolt.org
Mon Jan 28 09:49:01 2002


>That would work for a boolean value, but length returns an int value. So,
>
>if (errormessage.length =3D=3D 0)
>  // array is empty

if (!property) returns true if

a) the property is boolean 'false'
b) the property is number 0
c) the property is an empty string ''

So if (!errormessage.length) works fine.

ppk

_________________________________________________________________
Join the world=92s largest e-mail service with MSN Hotmail.
http://www.hotmail.com