How to simulate JavaScript yield?
<p>One of the new mechanisms available in JavaScript 1.7 is <a href="https://developer.mozilla.org/en/JavaScript/Guide/Iterators_and_Generators" rel="nofollow">yield</a>, useful for generators and iterators.</p>

<p>This is currently supported in Mozilla browsers only (that I'm aware of). What are some of the ways to simulate this behavior in browsers where it is not available?</p>
