How to implement nested arrays correctly?

I’m trying to make a map creation system similiar to a risk strategy game, I want to store the data for each map in a group of nested arrays but I’m really bad with arrays and can’t get them to work, here is what I would like to do (but doesn’t work):

	map['maxPlayers'] = 2;
	map['platforms'] = Array;
	
	//Platform 1
	map['platforms'][0] = Array;
	map['platforms'][0]['ID'] = 1;
	map['platforms'][0]['ownerID'] = 1;
	map['platforms'][0]['type'] = 1;
	map['platforms'][0]['troopCount'] = 1;
	map['platforms'][0]['atkBonus'] = 1;
	map['platforms'][0]['defBonus'] = 1;
	map['platforms'][0]['proBonus'] = 1;
	map['platforms'][0]['nodes'] = 1;
	
	//Platform 2
	map['platforms'][1] = Array;
	map['platforms'][1]['ID'] = 1;
	map['platforms'][1]['ownerID'] = 1;
	map['platforms'][1]['type'] = 1;
	map['platforms'][1]['troopCount'] = 1;
	map['platforms'][1]['atkBonus'] = 1;
	map['platforms'][1]['defBonus'] = 1;
	map['platforms'][1]['proBonus'] = 1;
	map['platforms'][1]['nodes'] = 1;

This is what would be ideal for me but I can’t get it to work, I’s sure it’s just some simple sintax problem I’m having but any help would be great thanks!

Hello,

Ok, there are so many problems with what you are doing:
Fistly, you can’t use a string to reference an item in an array. Only indecies work.
Secondly, you have to initialize Arrays, using “new Array()”
Thirdly, you can’t add things to an array by setting a value to an I referenced index.
Fourthly, you should never use "Array"s they are memory hungry and slow. Use generic lists instead.
Fithly, for your purpose, I suggest using “Classes” instead of arrays/lists. Look them up and see their awesomeness!!!

Hope this helps,
Benproductions1