Created
November 27, 2017 13:55
-
-
Save seogi1004/fb9db460fcbeb835248ac92230c5732d 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 Test = function() { | |
this.print= function() { | |
this.constructor.show(); | |
}; | |
}; | |
Test.show = function() { | |
alert("Test.show"); | |
}; | |
var t1 = new Test(); | |
var t2 = new Test(); | |
console.log(t1.constructor === t2.constructor); | |
var ct1 = new t1.constructor(); | |
var ct2 = new t2.constructor(); | |
ct1.print(); | |
ct2.print(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment