subclass

Simple prototypal inheritance, subclassing, extending, decorators, mixins, factories, and statics.

subclass.js

A small and simple way to inherit, extend, decorate, and override JavaScript classes and instances in an efficient and convenient manner.

506 bytes (minified and gzipped).

Subclass Extendable to create your first class.

var Car = Extendable.extend(function(options) {
  // ... constructor 
}).shared({
  // ... prototype members 
}).statics({
  // ... static members 
});

Which itself can be subclassed.

var Audi = Car.extend( /* ... */ );
var Toyota = Car.extend( /* ... */ );

And whose subclasses can also be subclassed.

var AudiHatchback = Audi.extend( /* ... */ );
var ToyotaHatchback = Toyota.extend( /* ... */ );