Creating a 2d array with the Array class


How do I create a 2d array that I can manipulate (change length) with the Javascript Array class? All the threads that i’ve found are people using the built in arrays, which have a fixed length. I can’t use those (it would be impractical), because my Array will be ever expanding. In case you’re wondering, it will represent a grid of blocks that make up my level.

I don’t think that the costly performance of 2d arrays will be an issue, since I will only have one, and the rest of the game logic is very, very simple.

Don’t use the Array class. It is slow and untyped. For your application, use one of the .NET collection classes. Most often for your situation, the generic List class is recommended. More info about collections: