title: JS find specific key in array of key-value pairs
body: <p>JavaScript</p>
  
  <pre><code>var myArray = [{key: "key1", value: "value1"},{key: "key1", value: "value1"}];
  </code></pre>
  
  <p>Is there an elegant mechanism for determining if "key1" is present ? </p>
  
  <p>In other words, a better mechanism than iterating through all array elements and checking each one.</p>
  
  <p>Edit:</p>
  
  <p>(1) keys are not necessarily unique </p>
  
  <p>(2) array must be composed of key-value pairs because I need to extract KVP subsets into other arrays , re-order , de-dupe , and many other complex operations</p>
  
  <p>Please re-open this question, thanks.</p>