hongr
01-15-2004, 03:01 AM
array1 = new Array("a1","a2","a3");
a1 = new Array("1", "2");
a2 = new Array("1", "2");
I have some arrays here. As you can see, some of the values of array1 match the names of the arrays below. What I want to do is to go through array1, and check to see if the matching array exists.
I tried this, but didnt work.
for (i=0; i<array1.length; i++)
{
if (array1[i].length > 0)
{
alert ("yes!");
}
}
when I did that, it actually got the length of the string "a1", not the array a1. How do I reference the match arrays correctly? thank you.
a1 = new Array("1", "2");
a2 = new Array("1", "2");
I have some arrays here. As you can see, some of the values of array1 match the names of the arrays below. What I want to do is to go through array1, and check to see if the matching array exists.
I tried this, but didnt work.
for (i=0; i<array1.length; i++)
{
if (array1[i].length > 0)
{
alert ("yes!");
}
}
when I did that, it actually got the length of the string "a1", not the array a1. How do I reference the match arrays correctly? thank you.