The Science of Programming/SwayPresentations/Objects/ClassAndObjectComponents3

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

Class and Object Components, continued

What about overriding simple variables?

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

What should obj . getValue() produce?

Previous Next Top