title: Override function (e.g. "alert") and call the original function?
body: <p>I would like to override a Javascript built-in function with a new version that calls the original (similarly to overriding a method on a class with a version that calls <code>super</code> in many languages). How can I do this?</p>
  
  <p>For example...</p>
  
  <pre><code>window.alert = function(str) {
      //do something additional
      if(console) console.log(str);
  
      //super.alert(str) // How do I do this bit?
  }
  </code></pre>