title: How to properly convert Observable into Array
body: <p>I am currently trying to convert an Observable into an Array so that I can iterate over the Array in HTML using ngFor.</p>
  <p>This is my Typescript code currently. When I console log the testArray Array it is saying it is undefined.</p>
  <pre><code>item$: Observable&lt;any[]&gt;;
  testArray: Array&lt;any[]&gt;;
  
    constructor(
      private afs: AngularFirestore,
      private route: ActivatedRoute,
    ) {
        this.item$ = afs.collection('testsTaken', ref =&gt; ref.where('testCreator', '==', this.id).where('testTitle', '==', this.testTitle)).valueChanges();
        this.item$.subscribe(x =&gt; this.testArray = x);
        console.log(this.testArray); // yields undefined
   
    }
  </code></pre>
  <p><a href="https://stackoverflow.com/questions/44940695/how-to-convert-observableany-to-array">I tried the advice given for this post and I still cant get it to work</a></p>