title: How to return an array with even number inside a two dimension array?
body: <p>I am trying to write a function that takes in a two dimension array and must return the vector that only contains even numbers. It is not supposed to copy the even array, just see if all numbers are even and return it.</p>
  <pre><code>var table = [ [1,2,3,4], [1,4,2,1], [9,9,9,9], [2,4,6,8] ] // -&gt; [2,4,6,8]
  </code></pre>
  <p>I am not sure about the if condition and the return inside the loop, but this is what I have:</p>
  <pre><code>var getTable=function(arr) {
    for(var i=0; i&lt;arr.length; i++) {
      for(var j=0; j&lt;arr[i].length; j++) {
        if((arr[i][j]%2)===0) {
          return arr[i][j];
        }
      }
    }
  }
  </code></pre>
  <p>Thank you.</p>