Flattening nested array in JavaScript
<p>I have a horrible looking array which looks like this:</p>

<p>EDIT:</p>

<pre><code>array = [
    {
        Letters: [{ Letter: 'A' }, { Letter: 'B' }, { Letter: 'C' }],
        Numbers: [{ Number: '1' }, { Number: '2' }, { Number: '3' }]
    },
    null,
    {
        Letters: [{ Letter: 'D' }, { Letter: 'E' }, { Letter: 'F' }, { Letter: 'G' }, { Letter: 'H' }],
        Numbers: [{ Number: '4' }, { Number: '5' }, { Number: '6' }, { Number: '7' }]
    }
];
</code></pre>

<p>And want the array to look like this:</p>

<pre><code>flattenedArray = [a,b,c,1,2,3,d,e,f,g,h,4,5,6,7]
</code></pre>

<p>Unfortunately I cannot change the original formatting because that is the form received when merging two API responses that I am getting.</p>

<p>I have tried using:</p>

<pre><code>var flattenedArray = [].concat.apply([], array);
</code></pre>

<p>But it just presents the array in the same format it was entered in.</p>

<p>I was wondering if anybody had any advice?</p>

<p>EDIT:
I have tried implementing the suggestions given - thank you so much for your help. It seems it is a problem with the format of the list - unfortunately using the chrome console which is in a 'tree' format I cannot see the direct structure of the array output.</p>

<p>Thank you for all your help!
EDIT 2: See above for the actual array, thank you for showing me how to see this!</p>