I have a function like below. When I create a new object of the function like this:
var newArray = new ArrayCollection ();
In the newArray I want to access the function property and class like this:
var first= newArray[0]
Instead of:
var first = newArray.Collections[0]
And:
newArray.add("a");
How to I modify the function to do this?
ArrayCollection = function ()
{
this.Collections = new Array();
this.add = function ( value )
{
....
};
this.remove = function ( value )
{
....
};
this.insert = function ( indx, value )
{
....
};
this.clear = function ()
{ ...
}
}
You can achieve like this