title: Filter an object iside an array
body: <p>I need to delete entire object that do not have passed</p>
  
  <p>here is the array</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>const array = [{
      course: 1,
      list: [{
          id: 1,
          name: "john",
          code: true
        },
        {
          id: 1,
          name: "maria",
          code: true
        },
      ]
    },
    {
      course: 2,
      list: [{
          id: 3,
          name: "rose"
        },
        {
          id: 4,
          name: "mark",
          code: true
        }
      ]
    }
  ]</code></pre>
  </div>
  </div>
  </p>
  
  <p>That i need is remove obj that not have code:true, and get this</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>const array = [{
      course: 1,
      list: [{
        id: 1,
        name: "john",
        code: true
      }, ]
    },
    {
      course: 2,
      list: [{
        id: 1,
        name: "mark",
        code: true
      }]
    }
  ]</code></pre>
  </div>
  </div>
  </p>
  
  <p>I tried to make a map inside a filter, but it does not work at all</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>const remove = array.filter(function(lines) {
    return lines.map(line =&gt; line.list.map(list =&gt; list.code))
  });</code></pre>
  </div>
  </div>
  </p>