title: How to replace javascript prototype with custom function
body: <pre><code>// I am trying to make a clone of String's replace function
  // and then re-define the replace function (with a mind to
  // call the original from the new one with some mods)
  String.prototype.replaceOriginal = String.prototype.replace
  String.prototype.replace = {}
  </code></pre>
  
  <p>This next line is now broken - how do I fix?</p>
  
  <pre><code>"lorem ipsum".replaceOriginal(/(orem |um)/g,'')
  </code></pre>