title: What is the most efficient way to empty a plain object in javascript?
body: <p>As stated <a href="https://stackoverflow.com/questions/1232040/how-to-empty-an-array-in-javascript">Here</a>, It seems that the most efficient way to empty an existing array (and NOT to allocate a new one) in javascript is to use:</p>
  
  <pre><code>array.length = 0;
  </code></pre>
  
  <p>Does the same operation work for plain objects? (aka "associative arrays" or "dictionaries")
  If not, what is the most efficient way to <strong>empty</strong> an existing javascript object?</p>
  
  <p>I think that allocating a new one is not the best option, since it will push some extra work to the garbage collector, and will allocate some new memory on the heap, but I might be wrong.</p>
  
  <p>I need a solution that works at least with Chrome and Firefox.</p>