title: filter and map on object of arrays based on property
body: <p>Hi I have an array <code>group</code> based on which I'm creating an array of categories for a certain language. I would like to produce the same array but only using filter and map methods.</p>
  <pre><code>  var group = [
      {
        nodes: [
          {
            frontmatter: {
              category: 'someCategory DE',
            },
            fields: {
              locale: 'de',
            },
          },
          {
            frontmatter: {
              category: 'HTML&amp;CSS DE',
            },
            fields: {
              locale: 'de',
            },
          },
        ],
      },
      {
        nodes: [
          {
            frontmatter: {
              category: 'react',
            },
            fields: {
              locale: 'en',
            },
          },
          {
            frontmatter: {
              category: 'HTML&amp;CSS',
            },
            fields: {
              locale: 'en',
            },
          },
          {
            frontmatter: {
              category: 'javascript',
            },
            fields: {
              locale: 'en',
            },
          },
          {
            frontmatter: {
              category: 'someCategory',
            },
            fields: {
              locale: 'en',
            },
          },
          {
            frontmatter: {
              category: 'HTML&amp;CSS',
            },
            fields: {
              locale: 'en',
            },
          },
          {
            frontmatter: {
              category: 'react',
            },
            fields: {
              locale: 'en',
            },
          },
        ],
      },
    ]
  </code></pre>
  <p>My working code without using filter and map.</p>
  <pre><code>const locale = 'de'
  const arr = []
  
  group.forEach(el =&gt; {
      el.nodes.forEach(e =&gt; {
        if (e.fields.locale == locale) {
          arr.push(e.frontmatter.category)
        }
      })
    })
  </code></pre>
  <p>expected result for example for <em>'en'</em> language</p>
  <pre><code>arr = [&quot;react&quot;, &quot;HTML&amp;CSS&quot;, &quot;javascript&quot;, &quot;someCategory&quot;, &quot;HTML&amp;CSS&quot;, &quot;react&quot;]
  </code></pre>
  <p>thank you</p>