Created
January 27, 2015 13:57
-
-
Save madx/bba95a111624134c2c42 to your computer and use it in GitHub Desktop.
A basic JS object system
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var assign = require("object-assign") | |
var Base = { | |
create: function create(properties) { | |
var base = Object.create(this) | |
properties = properties || {} | |
properties.parent = this | |
assign(base, properties) | |
return base | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment