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