title: Checking if element exists in array without iterating through it
body: <p>my array:</p>
  
  <pre><code>tempListArray = "[{"id":"12","value":false},{"id":"10","value":false},{"id":"9","value":false},{"id":"8","value":false}]";
  </code></pre>
  
  <p>To check if an element exists I would do this:</p>
  
  <pre><code>for (var i in tempListArray) {
      //check flag
      if (tempListArray[i].id == Id) {
          flagExistsLoop = 1;
          break;
      }
  } 
  </code></pre>
  
  <p>Is there anyway, I can check if an Id exists without looping through the whole array. Basically I am worried about performance if say I have a 100 elements.</p>
  
  <p>Thanks</p>