title: Javascript array of arrays that contains obj, take only arrays that contain an obj with a specific key
body: <p>I have array of arrays that contains obj, I should only take arrays that contain an obj with a specific key.</p>
  <p>I tried to use a double filter but it doesn't work.</p>
  <p>Can you give me some advice?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let result = [
    [
      {
        "id": 1
      },
      {
        "id": 2
      }
    ],
    [
      {
        "id": 3
      },
      {
        "id": 4
      },
      {
        "id": 5,
        "type": {
          "id": 1555
        }
      }
    ],
    [
      {
        "id": 6,
        "type": {
          "id": 5456
        }
      }
    ]
  ];
  
  const c = result.filter(array =&gt; array.filter(a =&gt; a.hasOwnProperty('type') === true));
  
  console.log(c);</code></pre>
  </div>
  </div>
  </p>
  <p>Result:</p>
  <pre><code>[
    [
      {
        &quot;id&quot;: 3
      },
      {
        &quot;id&quot;: 4
      },
      {
        &quot;id&quot;: 5,
        &quot;type&quot;: {
          &quot;id&quot;: 1555
        }
      }
    ],
    [
      {
        &quot;id&quot;: 6,
        &quot;type&quot;: {
          &quot;id&quot;: 5456
        }
      }
    ]
  ]
  </code></pre>