title: How to get Array inside Array data to another array in angular 7
body: <p>I have a json data set with arrays.I want to retrieve data from that set to another array.</p>
  
  <p>this is my json data</p>
  
  <pre><code>[
      {
          "user": [
              {
                  "userActivityId": "08d66e8f-0f2f-3162-4d1d-b0307df0b532",
                  "userId": "08d65df8-5a1c-4879-b8b6-f583bafa8084",
                  "userName": "Dorothy",
                  "photoUrl": "08d65df8-5a1c-d841-cff6-444e72fa08f2",
                  "createdOn": "2018-12-31T01:13:23.363154",
                  "itemType": 0,
                  "itemId": "08d66e8f-0f2f-2efa-db7a-ab313ff89e7c"
              },
              {
                  "userActivityId": "08d66e8f-19cf-7c9c-1e07-00c9e7c37fc0",
                  "userId": "08d65df8-5a1c-4879-b8b6-f583bafa8084",
                  "userName": "Dorothy",
                  "photoUrl": "08d65df8-5a1c-d841-cff6-444e72fa08f2",
                  "createdOn": "2018-12-31T01:13:41.190886",
                  "itemType": 1,
                  "itemId": "08d66e8f-19cf-a711-47a1-9690d9f6bf5e"
              }
          ]
      },
      {
          "user": [
              {
                  "userActivityId": "08d66e3f-61e0-55db-f57d-5d434738d366",
                  "userId": "08d6630e-325b-3474-5b5c-3c07af8063b8",
                  "userName": "Supun",
                  "photoUrl": "1",
                  "createdOn": "2018-12-30T15:43:02.314203",
                  "itemType": 0,
                  "itemId": "08d66e3f-61df-c79d-dac4-f16f1142d526"
              }
          ]
      }
  ]
  </code></pre>
  
  <p>What I want to do is,I want to get this data set inside user array values to single array.</p>
  
  <p>This is the way I followed,</p>
  
  <pre><code>friendsStufs: any[];
   this.userService.getFriendsStufs(this.authService.currentUser.id).subscribe(data =&gt; {
    data.forEach(user =&gt; {
      user.forEach(stufs =&gt; {
        this.friendsStufs.push(stufs);
      });
    });
  }, error =&gt; {
    console.log(error);
    this.alertify.error('Can retrieve friends stufs');
  });
  </code></pre>