Skip to content

Instantly share code, notes, and snippets.

@protometa
protometa / uber.js
Last active December 29, 2015 12:39
Uber simple ad hoc prototype inheritance
/*
uber simple ad hoc prototype inheritance
advantages:
- simple to use, construct inheritance on the fly or apply multiple inheritace
- perserve super methods with custom namespace
- flat prototype layer improves performance (no deep tree searches)
- prototyped methods save memory (even though each instance has it's own prototype object, each method is only defined once)