Skip to content

Instantly share code, notes, and snippets.

@j1n6
Created April 30, 2014 00:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save j1n6/9263c63bc0edaa3c130a to your computer and use it in GitHub Desktop.
Save j1n6/9263c63bc0edaa3c130a to your computer and use it in GitHub Desktop.
var extend = function(child) {
var base = this;
if(child) {
for(var prop in child) {
base[prop] = child[prop];
}
for(var prop in child) {
base.prototype[prop] = child[prop];
}
}
return base;
};
var Model = function() {
this.data = {};
}
Model.prototype.set = function(key, value) {
this.data[key] = value;
}
Model.prototype.get = function(key) {
return this.data[key];
}
Model.extend = extend;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment