The Science of Programming/SwayPresentations/Objects/ClassAndObjectComponents3

From Wikibooks, open books for an open world
< The Science of Programming‎ | SwayPresentations/Objects
Jump to: navigation, search

Class and Object Components, continued

What about overriding simple variables?

   function z()
       {
       var value = 3;
       function getvalue() { value; }
       this;
       }
   
   function x()
       {
       var value = 4;
       extends(z());
       }
   
   var obj = x();

What should obj . getValue() produce?


Previous Next Top