title: How do I filter through an Array with multiple objects in an Array and return lengths
body: <p>I have an Array with multiple objects</p>
  <pre><code>var List = [
    {
    name: 'John',
    city: 'Denver',
    email: 'johnson@mail.com'
    },
    {
    name: '',
    city: 'Dever',
    email: 'tom@mail.com'
    },
    {
    name: 'Mark',
    city: '',
    email: '',
    }
  ];
  </code></pre>
  <p>I have previously use filters to return a total number of names filled out.</p>
  <pre><code>// returned filled out names
  let total_name = List.filter((c: { name: any }) =&gt; !!c.name).length;
  console.log(total_name); // returns 2
  </code></pre>
  <p>What I am trying to accomplish is filter though all three or more objects and get total length of the items i.e 9 and get the total length of filled out items which would be 5 total length.</p>
  <p>changes I made to the answer I accepted.</p>
  <pre><code>isFilledLength(arr: any[], status: string) {
    let y = 0;
    arr.forEach((item) =&gt; {
      for (const x in item) {
        if (!!item[x] &amp;&amp; status=='filled')
          y++;
        if(status=='full')
          y++;
      }
    });
    return y;
  }
  </code></pre>