> function createArraySubclass(proto,...values) {
>    return proto <| [...values].{
>          [Array.derivedArrayKey](){return proto<| [ ]}
>    }
> }

I’m curious: Why wouldn’t one extend Array, instead?

function SubArray() {
}
SubArray.prototype = Object.create(Array.prototype);
SubArray.prototype.pushAll = function() {
    Array.prototype.push.apply(this, arguments);
    return this;
}
var s = new SubArray().pushAll(3,4,5);



-- 
Dr. Axel Rauschmayer
a...@rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com



_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to