Skip to content

Instantly share code, notes, and snippets.

@natasv
Last active September 30, 2016 14:18
Show Gist options
  • Save natasv/6578061dcad134683963d53e3499cb32 to your computer and use it in GitHub Desktop.
Save natasv/6578061dcad134683963d53e3499cb32 to your computer and use it in GitHub Desktop.
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