Hi,
I'm trying to use what is held in a variable to get to an object property:
img_lib.section s is an array containing a varying number of strings - eg "Category1","Ca tegory2" etc
img_lib.Categor y1 is an array that contains a varying number of strings
In the second for statement I need to compare j to the length of the img_lib.* array as retrieved from img_lib.section s[i]
I started with the code as shown below but I don't believe it works.
Suggestions?
I'm trying to use what is held in a variable to get to an object property:
img_lib.section s is an array containing a varying number of strings - eg "Category1","Ca tegory2" etc
img_lib.Categor y1 is an array that contains a varying number of strings
In the second for statement I need to compare j to the length of the img_lib.* array as retrieved from img_lib.section s[i]
I started with the code as shown below but I don't believe it works.
Suggestions?
Code:
for (i=0; i<img_lib.sections.length; i++){
alert("Primary Loop");
category=img_lib.sections[i];
cat_arr_str="img_lib.".category."[i]";
for(j=0; j<cat_arr_str.length; j++){
alert("Secondary Loop");
}
}
Comment