Skip to content

Instantly share code, notes, and snippets.

View toddfast's full-sized avatar

Todd Fast toddfast

  • San Francisco Bay Area
View GitHub Profile
@toddfast
toddfast / modular_inheritance.js
Created October 2, 2020 22:00
A test case for a module-like pattern for inheritance using Object.create(). Useful in older JS versions, requiring just a shim for Object.create().
Parent.count = 0;
function Parent(val) {
var value = val;
var index = -1;
(function constructor(c) {
index = c;
})(Parent.count++);