Skip to content

Instantly share code, notes, and snippets.

@edmore
Created October 24, 2011 11:30
Show Gist options
  • Save edmore/1308818 to your computer and use it in GitHub Desktop.
Save edmore/1308818 to your computer and use it in GitHub Desktop.
Functional Inheritance
var person = function(spec){
var that = {};
that.getName = function(){
return spec.name;
};
that.getSex = function(){
return spec.sex;
};
return that;
};
var developer = function(spec){
var that = person(spec);
that.getLanguage = function(){
return spec.language;
};
that.getExperience = function(){
return "Years of experience : " + spec.experience;
};
return that;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment