title: Javascript how to filter 2d array?
body: <p>I need to filter an array, so I've this code that works for a normal array</p>
  
  <pre><code>var arr = [138,124,128,126,140,113,102,128,136,110,134,132,130,132,132,104,116,135,120];
  
  var limit = 112;
  
  var lowarray = arr.filter(function(x) {
      return x &lt;= limit;
  });
  
  var higharray = arr.filter(function(x) {
      return x &gt; limit;
  });
  
  console.log(lowarray);
  console.log('');
  console.log(higharray);
  </code></pre>
  
  <p>The problem is that I've to apply it to a 2d array but I tried and no results!</p>
  
  <p>for example I've this array</p>
  
  <pre><code>var arr [[1,5],[2,4],[3,6],[4,2],[5,2]];
  </code></pre>
  
  <p>I wanna split it with the same idea</p>
  
  <pre><code>var limit = 3;
  </code></pre>
  
  <p>so the lowarray would be</p>
  
  <pre><code>[[1,5],[2,4],[3,6]];
  </code></pre>
  
  <p>and the higharray would be</p>
  
  <pre><code>[[4,2],[5,2]];
  </code></pre>
  
  <p>Any Idea?</p>