title: How to remove empty array values ("") from an array?
body: <p>I have an two dimensional array, generated from a html table with jQuery, but some values are empty so <code>&quot;&quot;</code> is displayed.</p>
  <p>How can I remove the empty values?</p>
  <pre><code>  &lt;table&gt;    
      &lt;tr&gt;
        &lt;th&gt;1A&lt;/th&gt;
        &lt;th&gt;1B&lt;/th&gt;
        &lt;th&gt;1C&lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;2A&lt;/td&gt;
        &lt;td&gt;2B&lt;/td&gt;
        &lt;td&gt;2C&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;/td&gt;
        &lt;td&gt;3B&lt;/td&gt;
        &lt;td&gt;3C&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
        &lt;td&gt;4C&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
  &lt;script&gt;
      var columns = $('tr').first().children().map(function(i) {
          return [
              $('tr').map(function(){
                  return $(this).children().eq(i).text()
              }).get()
          ]
      }).get();
  &lt;script&gt;
  </code></pre>
  <p><strong>I already tried following code:</strong></p>
  <pre><code>for( var i = 0; i &lt; columns[0].length; i++){ 
     if ( columns[0][i] === &quot;&quot;) {
      columns[0].splice(i, 1); 
     }
  }
  </code></pre>
  <p>It worked for some empty values, but not all of them got removed for some reason.</p>
  <p>Output: <a href="https://imgur.com/e7BAdQK" rel="noreferrer">https://imgur.com/e7BAdQK</a></p>