<p>I want to allocate a 2 D Array in Java Script. </p>

<p>I want do some thing similar to this in JavaScript</p>

<pre><code>typedef struct
{
   int  itemA,
   int  itemB,
   string testC
} myStruc;

myStruct MyArray [100];
</code></pre>

<p>How to do this ? </p>

There are  a few ways of creating arrays in Javascript, the method closest to what you want to do should be:
```
```
var myArray = new Array("someString1", "someString2", "someString3", ...);
```
```
You can replace
```
"someString1"
```
with actual objects.
You can also use the Array constructor to set up the initial length:
```
```
var myArray = new Array(5);
myArray[0] = ...;
myArray[1] = ...;
```
```
Arrays in Javascript are pretty loose actually - you don't even need to define the length before you access an element that would normally be outside the bounds of the array.
Take a look at
the Mozilla documentation on Arrays
.