Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var A = function() { console.log("This is Constructor A"); };
- A.prototype.x = function() { console.log("This is A.prototype.x"); };
- var B = new A();
- B.x(); //"This is A.prototype.x"
- B.__proto__.x = function() { console.log("Edit B.__proto__.x"); };
- B.x(); //"Edit B.__proto__.x"
- var C = new A();
- C.x(); //Edit B.__proto__.x
- C.__proto__.x = function() { console.log("Edit C.__proto__.x"); };
- C.x(); //Edit C.__proto__.x
- B.x(); //Edit C.__proto__.x
- A.prototype.x(); //Edit C.__proto__.x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement