...

View Full Version : Check if array is empty



maxpouliot
05-24-2006, 04:43 PM
Hi,

how can i check if an array is initionalized like this


var arrayEmp=[];

but is empty

something like this but this doesnt work


if(arrayEmp="")
{
alert(1);
}

mrhoo
05-24-2006, 04:47 PM
if(A && A.length==0)
or if you have other objects that A may be:
if(A && A.constructor==Array && A.length==0)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum