I have a JSON object that goes somewhat like this:
var waitingGames = {
arithemetic:[
{
games:[]
},
{
games:[]
},
{
games:[]
}
]
and so on for synonyms, antonyms and translation. My problem is that I can't seem to access the games array by using this:
var gametype = url_parts.query.type;
var gamesize = url_parts.query.size;
if(games.waitingGames.gametype[gamesize].games.length == 0)
I get that gametype is undefined, even though I already tried printing the variable and it has the right value (arithemetic in the above example). Any ideas how to fix this?