0

I have a simple javascript question. But I can't seem to answer it myself. I am trying to access data inside a two dimensional array, that array is inside an object and that object is inside another object. Finally all of these objects are inside another array. I have simplified the structure below. I am accessing the data from a triple for/in loop. The returned value should be "a" which is the first slot in the first array. But for some reason I am getting the value: 0. I am not sure what I am doing wrong. I must be overlooking something simple. Please help.

var games = [{ "maps": {
                    "dungeon": [
                        ["a","b","c","d","e","f","g","h","i","j"],
                        ["k","l","m","n","o","p","q","r","s","t"],
                        ["u","v","w","x","y","z","a","b","c","d"]
                    ]
                }
            }];

for(game in games)
    for(maps in game)
        for(map in maps)
            document.write(map[0][0]);

0 Answers0