title: In JavaScript is Object.keys().forEach() less memory efficient than a simple for...in loop?
body: <p>Imagine you have a very large JS object, containing millions of key/value pairs, and you need to iterate over them.</p>
  
  <p><a href="http://jsperf.com/object-keys-vs-for-in-with-closure/10" rel="nofollow">This jsPerf example</a> shows the main ways to do it, and outlines the speed differences.</p>
  
  <p>What I wonder though is: using <code>Object.keys()</code> would have a different impact on memory compared to the other looping methods, since it needs to create the "index" array that contains all the object keys first?</p>
  
  <p>Are there any optimizations in the source code that prevent this?</p>