title: Concatenate a two dimensional array
body: <p>I'm new and I need help to find the right solution for my function in java</p>
  
  <pre><code>function concatenateMatrix(matrix) {}
  var stringMatrix = [
      ['H', 'e', 'l', 'l', 'o'],
      [' ', 'J', 'a', 'v', 'a'],
      ['W', 'o', 'r', 'l', 'd', '!']
  ];
  var matrix = '';
  newArray = [];
  for (var i = 0; i &lt; stringMatrix.length; i++) {
      for (var j = 0; j &lt; stringMatrix[i].length; j++);
      newArray.push(stringMatrix);
      stringMatrix = '';
  }
  console.log(concatenateMatrix(stringMatrix))
  </code></pre>
  
  <p>It should be Hello , Java World! displayed.</p>
  
  <p>What do I wrong? Thanks a lot</p>
  
  <p>I have solved it, thanks a lot</p>
  
  <pre><code>for(var x in stringMatrix) {
  if(stringMatrix[x] instanceof Array) {
      stringMatrix[x] = stringMatrix[x].join("");
  }
  </code></pre>
  
  <p>}
  var concatenateMatrix = stringMatrix.join("");</p>
  
  <p>return concatenateMatrix;</p>