A
Ant
Hi,
I'm using an associative array to simulate a multidimensional array like
this:
myArray['00'] = "John";
myArray['01'] = "35";
myArray['02'] = "12345";
myArray['03'] = "01/01/1975";
myArray['10'] = "Sarah";
myArray['11'] = "29";
myArray['12'] = "56789";
myArray['13'] = "12/12/19";
I'm trying to work out how to loop through the entire array and I'm having
some problems.
for (var i = 0; i < arrayCount; i++)
{
for (var j = 0; j < attribCount; j++)
{
alert(myArray[i + j]);
}
}
Now this doesn't work as it's adding the i and j together rather than
joining them. And it doesn't work when I do 'i' and 'j' so I'm wondering, is
it actually possible to loop through the array?
Thanks for any help.
I'm using an associative array to simulate a multidimensional array like
this:
myArray['00'] = "John";
myArray['01'] = "35";
myArray['02'] = "12345";
myArray['03'] = "01/01/1975";
myArray['10'] = "Sarah";
myArray['11'] = "29";
myArray['12'] = "56789";
myArray['13'] = "12/12/19";
I'm trying to work out how to loop through the entire array and I'm having
some problems.
for (var i = 0; i < arrayCount; i++)
{
for (var j = 0; j < attribCount; j++)
{
alert(myArray[i + j]);
}
}
Now this doesn't work as it's adding the i and j together rather than
joining them. And it doesn't work when I do 'i' and 'j' so I'm wondering, is
it actually possible to loop through the array?
Thanks for any help.