var d3_arraySubclass = [].__proto__? // Until ECMAScript supports array subclassing, prototype injection works well. function(array, prototype) { array.__proto__ = prototype; }: // And if your browser doesn't support __proto__, we'll use direct extension. function(array, prototype) { for (var property in prototype) array[property] = prototype[property]; };