Last active
October 7, 2019 03:23
-
-
Save jk195417/aba5d2dd80eeadbc65c98379cb9e2243 to your computer and use it in GitHub Desktop.
This file contains 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 A = function() {} | |
A.prototype.value = 'a' | |
var B = function() {} | |
B.prototype = new A() | |
B.prototype.value = 'b' | |
new B().value // return 'b' |
Author
jk195417
commented
May 8, 2019
•
var A = function() {}
A.prototype.value = 'a'
var a = new A()
var B = function() {}
B.prototype = A.prototype
B.prototype.value = 'b'
var b = new B()
a.value == b.value // return true //wwwww
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment