title: for-in vs Object.keys forEach without inherited properties
body: <p>I was looking at a perf benchmark of <code>Object.keys</code> +  <code>forEach</code> vs <code>for-in</code> with normal objects.</p>
  
  <p><a href="http://jsperf.com/for-in-versus-object-keys-foreach" rel="noreferrer">This</a> benchmark shows that <code>Object.keys</code> + <code>forEach</code> is <strong>62% slower</strong> than the <code>for-in</code> approach. But what if you don't want to get the <em>inherited properties</em>? <code>for-in</code> includes all non-native inherited objects, so we'll have to use <em>hasOwnProperty</em> to check.</p>
  
  <p>I tried to make another <a href="http://jsperf.com/object-keys-foreach-vs-for-in-hasownproperty" rel="noreferrer"><strong>benchmark here</strong></a> doing exactly that. But now the <code>for-in</code> approach is <strong>41% slower</strong> than <code>Object.keys</code> + <code>forEach</code>.</p>
  
  <hr>
  
  <p><em>update</em></p>
  
  <p>The above test was done in Chrome. Tested it again but with Safari and I'm getting different results: <code>Object.keys(..).forEach(..) 34% slower</code>, odd.</p>
  
  <blockquote>
    <p>Note: The reason I'm benchmarking is to check how it is with <strong>Node.js</strong>. </p>
  </blockquote>
  
  <p>Questions:</p>
  
  <ul>
  <li>Are the <code>jsperf</code> result for <em>Chrome</em> considerable for <strong>Node.js</strong>?</li>
  <li>What happened, how come a single conditional made the <code>for-in</code> approach <strong>41% slower</strong> than <code>Object.keys</code> + <code>forEach</code> in <em>Chrome</em>?</li>
  </ul>