Created
November 27, 2017 14:02
-
-
Save seogi1004/31b84408c18b683cdf7eb21fe49ac286 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 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