Skip to content

Instantly share code, notes, and snippets.

@seogi1004
Created November 27, 2017 14:02
Show Gist options
  • Save seogi1004/31b84408c18b683cdf7eb21fe49ac286 to your computer and use it in GitHub Desktop.
Save seogi1004/31b84408c18b683cdf7eb21fe49ac286 to your computer and use it in GitHub Desktop.
var Parent = function() {
this.print= function() {
alert("Parent, this.print");
};
};
var Children = function() {
/*
this.print=function() {
alert("Children, this.print");
};
*/
};
Object.prototype.print= function() {
alert("Object.prototype.print");
};
Parent.prototype.print= function() {
alert("Parent.prototype.print");
};
/*
Children.prototype.print=function() {
alert("Children.prototype.print");
};
*/
Children.prototype = new Parent;
var children = new Children();
children.print();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment