title: JavaScript library to simulate Internet Explorer JavaScript environment?
body: <p>This is not a duplicate of the <a href="https://stackoverflow.com/questions/10569512/js-library-to-simulate-internet-explorer">JS library to simulate Internet Explorer?</a> question about simulating Internet Explorer's CSS support; this is about JavaScript functions.</p>
  <p><strong>Does a JavaScript library exist which can simulate an environment like Internet Explorer's, whereas JavaScript functions are concerned?</strong></p>
  <p>Basically, it would remove/overwrite the functions not supported by older versions of IE (like indexOf, etc.) or at least force any call to them to be ignored somehow.</p>
  <p><em>Effectively, what I'm looking for is something almost like the opposite of <a href="http://underscorejs.org/" rel="noreferrer">Underscore.js</a> and which theoretically could even be used to test (in non-IE browsers) that Underscore.js is doing what it's meant to do.</em></p>
  <p><em>Or</em> is the amount of effort needed to simulate the environment so small that I can do it quickly myself? If so, how?</p>
  <hr />
  <h3>The use case I'm imagining:</h3>
  <p>Using this script to simulate an IE7 environment in <a href="http://phantomjs.org/" rel="noreferrer">Phantom.js</a>'s WebKit browser for automated (by Jenkins) JavaScript unit-testing with Jasmine / QUnit / etc (undecided).</p>