How to return multiple object form the js function
<p>I have a function like below. When I create a new object of the function like this:</p>

<pre><code>var newArray = new ArrayCollection ();
</code></pre>

<p>In the <code>newArray</code> I want to access the function property and class like this:</p>

<pre><code>var first= newArray[0]
</code></pre>

<p>Instead of:</p>

<pre><code>var first = newArray.Collections[0]
</code></pre>

<p>And:</p>

<pre><code>newArray.add("a");
</code></pre>

<p>How to I modify the function to do this?</p>

<pre><code>ArrayCollection = function ()
{
    this.Collections = new Array();

    this.add = function ( value )
    {
     ....
    };
    this.remove = function ( value )
    {
       .... 
    };
    this.insert = function ( indx, value )
    {
      ....
    };
    this.clear = function ()
    {   ...

    }

}
</code></pre>
