Bankowo jest jakiś sposób, którego nie mogę sobie za nic przypomnieć, ale łap kawałek kodu:
var array = [ 1, 2, [ 3, 4, [ 5, 6 ] ] ];
function unzipArrayValues( array ) {
var result = [];
for(var index = 0; index < array.length; index ++) {
var item = array[ index ];
if( typeof item === 'object' )
result = result.concat( unzipArrayValues( item ) );
else
result.push( item );
}
return result;
};
unzipArrayValues( array ); // returns [1, 2, 3, 4, 5, 6]