title: Adding code to a javascript function programmatically
body: <p>I'm attempting to customize an existing JS library without modifying the original JS code.  This code loads in a few external JS files which I do have access to, and what I'd like to do is change one of the functions contained in the original file without copying and pasting the whole thing into the second JS file.
  <br>
  So for example, the off limits JS might have a function like this:</p>
  
  <pre><code>var someFunction = function(){
      alert("done");
  }
  </code></pre>
  
  <p>I'd like to be able to somehow append or prepend some JS code into that function.  The reason is primarily that in the original untouchable JS the function is pretty enormous and if that JS ever gets updated, the function I overwrite it with will be out of date.</p>
  
  <p>I'm not entirely sure this is possible, but I figured I'd check.</p>