title: Check if array of objects contain certain key
body: <p>I need to determine if a certain key exists in an array of objects.</p>
  
  <p>Here is a sample array:</p>
  
  <pre><code>arrOfObj = [{
          "mainKey1": {
              "subKey1": {
                  "innerKey1": {
                      "innerMostKey1": {
                          "key1": "value"
                      }
                  }
              }
          }
      }, {
          "mainKey2": {
              "key2": "value"
          }
      }, {
          "mainKey3": {
              "subKey3": {
                  "key3": "value"
              }
          }
      }
  ]
  </code></pre>
  
  <p>I was trying to do this but I get the wrong output:</p>
  
  <pre><code>const objKeys = Object.keys(arrOfObj)
  console.log('objKeys = ' + JSON.stringify(arrOfObj))
  </code></pre>
  
  <p>Output is the index numbers:</p>
  
  <pre><code>objKeys = ["0", "1", "2"]
  </code></pre>
  
  <p>I want to have a function that works like this:</p>
  
  <pre><code>var isKeyPresent = checkKeyPresenceInArray('mainKey3')
  </code></pre>
  
  <p>Please note though that I only need to check the topmost level in the objects - in above example, these are the main keys (<code>mainKey1</code>, etc) and that their content is dynamic (some others have deeply nested object inside and some not so.</p>
  
  <p>Help!</p>