title: JavaScript override methods
body: <p>Let's say you have the below code:</p>
  
  <pre><code>function A() {
      function modify() {
         x = 300;
         y = 400;
      }
  
      var c = new C();
  }
  
  function B() {
      function modify(){
         x = 3000;
         y = 4000;
      }
  
      var c = new C();
  }
  
  C = function () {
     var x = 10;
     var y = 20;
  
     function modify() {
        x = 30;
        y = 40;
     };
  
     modify();
     alert("The sum is: " + (x+y));
  }
  </code></pre>
  
  <p>Now the question is, if there is any way in which I can override the method <code>modify</code> from <code>C</code> with the methods that are in <code>A</code> and <code>B</code>. In Java you would use the <code>super</code>-keyword, but how can you achieve something like this in JavaScript?</p>