Last active
September 30, 2016 14:18
-
-
Save natasv/6578061dcad134683963d53e3499cb32 to your computer and use it in GitHub Desktop.
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 Person = function(name) { | |
this.name = name; | |
} | |
Person.prototype.greet = function(){ | |
console.log("Hi, " + this.name); | |
} | |
var Developer = function(name, skills) { | |
Person.apply(this.arguments); | |
this.skills = skills || []; | |
} | |
Developer.prototype = Object.create(Person.prototype); | |
Developer.prototype.constructor = Developer; | |
var dev = new Developer("Jhon", ["js", "php"]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment