Axel Rauschmayer (2011-10-21T16:36:28.000Z)
In a vein similar to making [] available to collections, one could make "new" and "instanceof" available to other inheritance schemes.

For example:

// “Meta-class” for prototypes as classes/instantiable prototypes
function ProtoExemplars() {}
ProtoExamplar.prototype.{
    operatorNew(...args) {
        let inst = Object.create(this);
        return inst.constructor(...args);
    },
    operatorInstanceof(lhs) {
        return this.isPrototypeOf(lhs);
    }
};

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com
github at esdiscuss.org (2013-07-12T02:24:05.019Z)
In a vein similar to making `[]` available to collections, one could make `new` and `instanceof` available to other inheritance schemes.

For example:

```javascript
// ?Meta-class? for prototypes as classes/instantiable prototypes
function ProtoExemplars() {}
  ProtoExamplar.prototype.{
    operatorNew(...args) {
        let inst = Object.create(this);
        return inst.constructor(...args);
    },
    operatorInstanceof(lhs) {
        return this.isPrototypeOf(lhs);
    }
};
```