Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function A() {
- this.instanceName = "A's instanceName";
- }
- A.prototype.nameA = "A's prototype";
- function B() {
- this.instanceName = "B's instanceName";
- }
- B.prototype = new A();
- B.prototype.nameB = "B's prototype";
- B.prototype.constructor = B;
- function C() {
- this.instanceName1 = "C's instanceName 1";
- this.instanceName2 = "C's instanceName 2";
- console.log(this.nameA);
- console.log(this.nameB);
- console.log(this.nameC);
- }
- C.prototype = new B();
- C.prototype.nameC = "C's prototype";
- C.prototype.constructor = C;
- var c = new C();
Add Comment
Please, Sign In to add comment