title: Javascript: Partially overwrite a function without overwriting a few lines of codes
body: <p>Straight to the point.
  I have a function in a javascript class E.G</p>
  
  <pre><code>export default class gf{
      iLoveThis(){
          this.state.MakeMeWhole = true;
          callBoyfriend();
      }
  }
  </code></pre>
  
  <p>And What Im doing is essentially overwriting the method in another JS file. Like so <strong>Note that I am extending the class into my other component class</strong></p>
  
  <pre><code>iLoveThis(){
      alert('Got Laid!');
      cheatOnBoyfriend();
  }
  </code></pre>
  
  <p>Is there any possible way for me to overwrite that method in another class without losing the this.state.MakeMeWhole line? The callBoyfriend call and other parts will be overwritten. 
  Assumptions to make is that I have implemented ILoveThis in many different different classes and so I prefer not to have to add additional codes in all the other classes but to modify the original method to accomplish this.</p>
  
  <p>Couldn't find any viable examples to accomplish this as most examples told me to save the method, overwrite it then re run it after overwriting the method and that would lead me to modifying 100's of classes...</p>
  
  <p><strong>Update</strong>
  What Needs to be done is </p>
  
  <pre><code>class Love {
    constructor(){
    this.state = 'love'
    }
  
    iLoveThis() {
    this.state = 'derp'
    callBoyfriend();
    }
  }
  
  class Love2 extends Love{
    iLoveThis() {
    cheatBoyfriend();//assume method exist
    console.log(this.state) // Somehow make this state as derp, means the codes in the original function are partially overwritten 
    }
  }
  </code></pre>
  
  <p>Credits for the codes belong to the guy who posted a response at the bottom of the page.
  Is this possible?</p>