title: Checking if a key exists in a JS object
body: <p>I have the following JavaScript object:</p>
  
  <pre><code>var obj = {
      "key1" : val,
      "key2" : val,
      "key3" : val
  }
  </code></pre>
  
  <p>Is there a way to check if a key exists in the array, similar to this?</p>
  
  <pre><code>testArray = jQuery.inArray("key1", obj);
  </code></pre>
  
  <p>does not work.</p>
  
  <p>Do I have to iterate through the obj like this?</p>
  
  <pre><code>jQuery.each(obj, function(key,val)){}
  </code></pre>