title: Create an array of first element of each array
body: <p>I have an array in maxtrix form like this</p>
  
  <pre><code>var costs = [
          [4, 6, 8, 8],
          [6, 8, 6, 7],
          [5, 7, 6, 8],
      ];
  </code></pre>
  
  <p>how do i transform it to this</p>
  
  <pre><code> [[4,6,5], [6,8,7], [8,6,5], [8,7,5]]
  </code></pre>
  
  <p>This is what am trying</p>
  
  <pre><code>var cols = [];
  
  for(var i = 0; i&lt;costs.length; i++)
  {
      cols.push(costs[i][0]);
  }
  
  return col;
  </code></pre>
  
  <p>And this gives me <code>[4,6,5]</code>. I know am missing something, any help will be great. Thanks</p>