title: Creating an array of other objects in javascript?
body: <p>Is something like this possible:</p>
  
  <pre><code>function FooClass()
  {
     var barsArray=new Array();
     var index=0;
  
     function addBar()
     {
       barsArray[index]=new BarClass(index);
     }
  }
  
  function BarClass()
  {
     var myIndex;
     function BarClass(index)
     {
        myIndex=index;
     }
  }
  </code></pre>