• property

constructor can.Construct.prototype.constructor

 

Property Type: {function()}

Returns

{undefined}

A reference to the constructor function that created the instance. This allows you to access the constructor's static properties from an instance.

Example

This class has a static counter that counts how mane instances have been created:

can.Construct("Counter", {
    count: 0
}, {
    init: function() {
        this.constructor.count++;
    }
});

new Counter();
Counter.count; // 1