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