title: Which is faster, For Loop or .hasOwnProperty?
body: <p>I was working on a project where I needed to pull a list of excluded users out of a giant list of user data. It made me wonder if it is faster to use a double <code>for loop</code> with excluded id's in an <code>array</code>. Or if putting the id's in object properties and using <code>.hasOwnProperty()</code> is faster.  </p>
  
  <pre><code>var mainList = LARGE JSON OBJECT OF DATA.
  var eArray = ["123456","234567","345678","456789","012345"];
  var eObject = {"123456":"0","234567":"0","345678":"0","456789":"0","012345":"0"};
  </code></pre>
  
  <p>Using the Double <code>For Loop</code> Approach:</p>
  
  <pre><code>for(i=0; i &lt; mainList.length; i++){
      for(j=0; j &lt; eArray.length; j++){
          if(mainList[i]['id'] === eArray[j]){
             //Do Something
          }
      }
  }
  </code></pre>
  
  <p>Using the <code>.hasOwnProperty()</code> Approach:</p>
  
  <pre><code>for(i=0; i &lt; mainList.length; i++){
      if(eObject.hasOwnProperty(mainList[i]['id'])){
         //Do Something
      }
  }
  </code></pre>
  
  <p>I realize there are other ways to make the loops faster, like storing lengths in variables. I've tried to simplify this.</p>
  
  <p>Thanks for any information.</p>