title: Concatenate arrays from the same array in JavaScript
body: <p>I have an array like this:</p>
  
  <pre><code>[
    {
      "id": 10002,
      "flag": false,
      "list": [
        "aaa",
        "bbb"
      ]
    },
    {
      "id": 10001,
      "flag": true,
      "list": [
        "10002",
        "10003"
      ]
    },
    {
      "id": 10003,
      "flag": false,
      "list": [
        "ccc",
        "ddd"
      ]
    }
  ]
  </code></pre>
  
  <p>i tried this 
  initially i have "10001" value so iterate this array to take "list" array if flag==true then stored into newarray.  but its not working.</p>
  
  <p>I want it to be like this: <code>[ "aaa", "bbb", "ccc", "ddd" ]</code>.</p>