Skip to content

Instantly share code, notes, and snippets.

@Zatvobor
Created April 11, 2014 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Zatvobor/10483850 to your computer and use it in GitHub Desktop.
Save Zatvobor/10483850 to your computer and use it in GitHub Desktop.
function Human (sex, age, name) {
this.sex = sex;
this.age = age;
this.name = name;
}
Human.prototype.say = function() {
console.log('my name is ' + this.name);
};
sergey = new Human('male', 25, 'Segey');
sergey.say();
function Man(age, name) {
this.age = age;
this.name = name;
}
Man.prototype = new Human('man', this.age, this.name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment