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