title: JavaScript Set Parent Value from Child Class
body: <p>I am in JavaScript.</p>
  
  <p>Below I have a <strong>Main</strong> object that instantiates the <strong>Handle</strong> class within it. I prefer <strong>composition</strong> over inheritance which is why I've <em>avoided prototyping</em> -- unless there is a way around it..</p>
  
  <pre><code>function Main() {
  
    this.changeMe = 1;
  
    this.init = function() {
      handle = new Handle();
      handle.setMe();
  
    }
  };
  
  function Handle() {
    this.setMe = function() {
       // parent::changeMe = 2; &lt;-- How would I change the parent value?    
    }
  };
  
  var app = new Main();
  main.init();
  console.log(main.changeMe); &lt;-- How do I get that to 2?
  </code></pre>
  
  <p>I am trying to figure out how I change the parent value. Do you know how?</p>