Created
April 11, 2014 16:52
-
-
Save Zatvobor/10483850 to your computer and use it in GitHub Desktop.
This file contains 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
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