I'm trying to use what is held in a variable to get to an object property:
img_lib.sections is an array containing a varying number of strings - eg "Category1","Category2" etc
img_lib.Category1 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.sections[i]
I started with the code as shown below but I don't believe it works.
Suggestions?
Expand|Select|Wrap|Line Numbers
- 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");
- }
- }