flatten a multidimensional array js code example Example: how can I flatten a two dimensional matrix in javascrip? var myNewArray = [].concat.apply([], myArray);