for the past six months I have been programming in nothing but OBJ-C and JAVA so I have been very used to being able accessing objects using object loops
In my JS program I am trying to access all of my created mapped objects and loop through them. How can I get a certain index's object (instead of using my mapped object reference). IE
var g = new game();
currentGames[23234395]= g
Lets say I have added three games. I need to be able to get the game by index not by the mapped number (which is just a unique id my data base and I need)
for(var i = 0;i<currentGames.length;i++)
{
var g = currentGames[i];
}
causes an error (obviously)
Is there any other way of accessing an object by index rather than my map?
EDIT:
I would like to know if i can do something like the following
for(var g in currentGames)
{
}
and g hold a reference to my game object at that index.