title: Filter an array inside an array
body: <p>i hope you cans help me with this... I'm using AngularJS =></p>
  
  <p>before sending a query in MongoDB, I have to filter an array, all the values come from ng-model, and it's created when the form is submitted, but before sending the query, i have to filter the array so I can discard undefined values,
  The structure is the following:</p>
  
  <pre><code>this.permision = [
      {
         title: 'Archivo',
         submenu: [this.menu.productCatalog, this.menu.providers]
      },
      {
         title: 'Usuarios',
         submenu: [this.menu.users, this.menu.roles]
      },
      {
          title: 'Presupuesto',
          submenu: [this.menu.invoiceLog, this.menu.requestLog, 
          this.menu.creditLog, this.menu.reportLog]
      },
      {
           title: 'Requerimientos',
           submenu: [this.menu.dps1f1, this.menu.catalog,
           this.menu.consolidate, this.menu.expenses,
           this.menu.purchaseGeneration, 
           this.menu.purchaseTracking,
           this.menu.circuits]
     },
     {
           title: 'Operaciones',
           submenu: [this.menu.account, this.menu.loadPay, 
           this.menu.accountStatus]
     },
     {
           title: 'Graficos',
           submenu: [this.menu.importFile]
     },
     {
           title: 'Cuenta Corriente',
           submenu: [this.menu.credit, this.menu.rates]
     },
  ];
  </code></pre>
  
  <p>How can I access the submenu array and filter it before sending the query? </p>
  
  <p>This is the answer i'm getting when i send the query:</p>
  
  <pre><code>{submenu:["DPS1F1", undefined, undefined, undefined, undefined, undefined, undefined] title : "Requerimientos"}
  </code></pre>
  
  <p>so, all the undefined values have to be removed, but they're in a deep position inside of the array. </p>
  
  <p><code>Array.filter()</code> doesn't seems to work and if I try to get <code>indexOf()</code> to use <code>Splice()</code> it doesn't seems to to work either? Thanks for your help. </p>