title: Get Last Value from Observable in Angular 8
body: <p>How do I get the last value from an Observable in Angular 8?</p>
  
  <pre><code>let test = new BehaviorSubject&lt;any&gt;('');
  test.next(this.AddressObservable);
  
  let lastValue = test.subscribe(data=&gt;console.log(data.value));
  </code></pre>
  
  <p>For some reason it is not working, checking debugger.</p>
  
  <p>However, this is working in html, <code>AddressObservable | async</code></p>
  
  <p>Trying to utilize this link, want to store value in variable or display in console log. Any newer syntax would be helpful .</p>
  
  <p><a href="https://stackoverflow.com/questions/37174598/how-to-get-last-value-when-subscribing-to-an-observable">How to get last value when subscribing to an Observable?</a></p>
  
  <p><strong>Note:</strong></p>
  
  <p><code>AddressObservable</code> is of type: <code>Observable&lt;AddressDto&gt;</code></p>