title: Check if a global property/function has been overwritten in JavaScript
body: <p>JavaScript makes it easy to overwrite properties and functions of the global object. I'd like to find a way to check if the original version of a global property has been replaced.</p>
  
  <p>Consider someone putting this in their HTML:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      window.encodeURIComponent = eval;
  &lt;/script&gt;
  &lt;script type="text/javascript" src="myscript.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>If myscript.js calls the encodeURIComponent function somewhere, it will now behave unpredictably. So is there a way I can check inside myscript.js if someone has overwritten that function before I use it?</p>