title: When did all browsers start supporting the String.replace(regexp, replacement_function)?
body: <p>According to the 6th Edition of <em>JavaScript: The Definitive Guide</em> (Flanagan, 2011):</p>
  <blockquote>
  <p>ECMAScript v3  specifies that the <em>replacement</em> argument to <code>replace()</code> may be a function instead of a string.</p>
  </blockquote>
  <p>I'm looking at some code written in 2005, where a <a href="https://stackoverflow.com/questions/15465522/why-is-string-replace-with-lambda-slower-than-a-while-loop-repeatedly-calling">complicated workaround</a> has been used to replace parts of a string. The comments for the code clearly indicate that it originally used the functional <code>replace()</code> method but that the workaround was necessary for cross-browser compatibility.</p>
  <p>ECMAScript v3 came out in 1999 and, as far as I can tell (from <a href="http://www.webmasterworld.com/forum91/68.htm" rel="noreferrer">this discussion post</a> and <a href="http://ejohn.org/blog/versions-of-javascript/" rel="noreferrer">this blog post</a>), ECMAScript v3 was supported across the main browsers since late 2001. Could the author have been wrong, or can someone shed light on why such a workaround might have been necessary in 2005?</p>
  <p>...</p>
  <p><strong>UPDATE</strong> The actual comment by the author of the code says:</p>
  <blockquote>
  <p>lambda functions in RegExps are currently a problem with too many browsers.</p>
  <p>changed code to work around.</p>
  </blockquote>
  <p>The author code works for or runs <a href="http://www.masswerk.at/info.html" rel="noreferrer">this business</a>, though the code itself may well be a personal project.</p>