Compare Revisions

Inheritance revisited

Revision 294541:

Revision 294541 by ethertank on

Revision 347887:

Revision 347887 by mua on

Title:
Inheritance revisited
Inheritance revisited
Slug:
JavaScript/Guide/Inheritance_Revisited
JavaScript/Guide/Inheritance_Revisited
Tags:
"JavaScript","OOP","Inheritance"
"JavaScript","OOP","Inheritance"
Content:

Revision 294541
Revision 347887
nn23 
nn30 
t33B.prototype = Object.create(new A(), {t35B.prototype = Object.create(A.prototype, {
34  varB : { value: null, enumerable: true, configurable: true, wri36  varB : {
>table: true }, 
37    value: null, 
38    enumerable: true, 
39    configurable: true, 
40    writable: true 
41  },
42  doSomething : { 
35  doSomething : { value: function(){ // override43    value: function(){ // override
36       A.prototype.doSomething.apply(this, arguments); // call su44      A.prototype.doSomething.apply(this, arguments); // call sup
>per>er
37       // ...45      // ...
38    }, enumerable: true, configurable: true, writable: true }46    },
47    enumerable: true,
48    configurable: true, 
49    writable: true
50  }
39})51});

Back to History