title: How to remove empty arrays from multidimensional array in JavaScript?
body: <p>I have a problem with removing empty arrays/objects from a multidimensional array for my search app in google sheets. I am using <code>getLastRow</code> so I thought I will avoid this problem but unfortunately it is not.</p>
  <p>My array looks like this:</p>
  <pre><code>[[1.39080000912E11, RSSMA004025, ﾎﾞﾀﾝｷｬｯﾌﾟ M4X25, 4.0, 4.2, , , ], [1.39080000912E11, RWJAA058068, FTB-268, 1.0, 486.0, 486.0, , ], [, , , , , , , ], [, , , , , , , ]]
  </code></pre>
  <p>And I am looking for something that will delete empty arrays from the end of the array so it should be like this:</p>
  <pre><code>[[1.39080000912E11, RSSMA004025, ﾎﾞﾀﾝｷｬｯﾌﾟ M4X25, 4.0, 4.2, , , ], [1.39080000912E11, RWJAA058068, FTB-268, 1.0, 486.0, 486.0, , ]]
  </code></pre>
  <p>It is just a part of the whole array but I hope you will understand what I am looking for.</p>
  <p>My code so far:</p>
  <pre><code>function getDataForSearch(){
      
    const ss = SpreadsheetApp.getActiveSpreadsheet();
    const ws = ss.getSheetByName(&quot;WP&quot;);
    
    var test1 = ws.getRange(4, 6, ws.getLastRow(),8).getValues();
  
  const arrFiltered = test1.filter(function(x){
    return (x !== (undefined || null || ''));
  });
  
   Logger.log(arrFiltered);
  
  }
  </code></pre>