title: add data to the end of a behavior object array Angular 5
body: <p>I have some data that I want to be shared with my entire app so I have created a service like so.. </p>
  
  <p><strong>user.service</strong></p>
  
  <pre><code>userDataSource = BehaviorSubject&lt;Array&lt;any&gt;&gt;([]);
  
  userData = this.userDataSource.asObservable();
  
  updateUserData(data) {
      this.userDataSource.next(data);
  }
  </code></pre>
  
  <p>then in my component Im getting some data from an api and then sending that data to <code>userDataSource</code> like so.. </p>
  
  <pre><code>constructor(
  private: userService: UserService,
  private: api: Api
  ){
  }
  
  ngOnInit() {
      this.api.getData()
        .subscribe((data) =&gt; { 
           this.userService.updateUserData(data);
        })
  }
  </code></pre>
  
  <p>now that all works but.. I want to be able to add data to the end of the array inside the <code>userDataSource</code> so basically the equivalent of a <code>.push</code> am I able to just call the <code>updateUserData()</code> function and add more data or will doing that overwrite what is currently in there?</p>
  
  <p>Any help would be appreciated</p>