I think the topic of this thread has derailed a bit.
Here is Andrea Giammarchi's take on subclassing Array

.
http://webreflection.blogspot.com/2008/05/habemus-array-unlocked-leng...
If Andrea had read Lasse's post, he might have reconsidered.
As I already stated, Array has a specialized [[Put]] method. The way
it works is that when you add a property to an array, if the property
is a number N (and the array does not have that property N), and N is
= the array's length, then the array's length gets increased to N+1;
You can try the stack example and quickly find that it behaves
differently from an Array.
var s = new Stack;
s.length; // 0
s[0] = 1; // 0
s.length; // 0. Yes, it is still 0.
for(var p in s) console.log(p); // includes constructor, length,
toString concat and 0.
An array has the following characteristics that differentiate it from
an object.
1) Specialized put
2) magic length
3) literal initializer syntax
Andreas "stack" has none of those characteristics. It would be
entirely possible to rewrite that construct as:
function Stack(){
this.items = [].slice(arguments);
}
Then it's possible to have the array of items work just like an Array
with no surprises. Anyone who knows how an Array works will know what
exactly items is.
Having an object that "has" an array property and delegates
functionality to that array allows extra functionality to be added to
the delegating object type (Stack, in this case).
Stack.prototype.fold = function() {
// do something with this.items.
};
Having a collection as a property can be useful for creating things
like a ListIterator(arrayLike). Wher - arrayLike - can be nodeList,
array, et c, and the ListIterator instance keeps track of an internal
- position - property for next, et c. This type of approach can
usually address the problem area that subclassing array attempts to
solve.
Garrett