In JavaScript, there are objects that pretend to be arrays (or are \"array-like\"). Such objects are arguments, NodeLists (returned from get
arguments
NodeList
get
I think this is what you are looking for. Override the toString function.
foo.prototype.toString = function() { return "[object Foo <" + this[0] +">]"; }