title: Loop through observable<Object[ ]> in Typescript
body: <p>I have a firebase database... So it's all JSON.
  I retrieve the data using AngularFire2 database...I'm reading <a href="http://javasampleapproach.com/firebase/ionic-3-firebase-example-crud-operations-with-firebase-realtime-database" rel="noreferrer">this</a> tutorial...</p>
  
  <p>The part of the code for this question is :</p>
  
  <pre><code>noteList: Observable&lt;Note[]&gt;
  
    constructor(public navCtrl: NavController, private noteListService: NoteListService) {
      this.noteList = this.noteListService.getNoteList()
        .snapshotChanges()
        .map(
        changes =&gt; {
          return changes.map(c =&gt; ({
            key: c.payload.key, ...c.payload.val()
          }))
        });
  </code></pre>
  
  <p>From here I want to do 2 things :</p>
  
  <ul>
  <li>1st : declare an array variable outside of the contructor, just like <code>noteList</code> Ex : <code>myVar: Note[] = new Array();</code></li>
  <li>2nd : Iterable though the result of the <code>getNoteList()</code> and push them into that variable for futher use... I hope to have <code>myVar</code> holding multiple objects of <code>Note</code> ...=> those are JSON from Firebase therefore JavaScript objects...</li>
  </ul>
  
  <p>How do I do that ?</p>
  
  <p>What I've go so far is using the following :</p>
  
  <p><code>this.noteList .forEach(value =&gt; console.log(value));</code> This will log each element of noteList  as <code>Array [Object]</code> .... </p>
  
  <p>When I do <code>this.noteList .forEach(value =&gt; this.myVar.push(value));</code> it says :</p>
  
  <blockquote>
    <p>Argument of type 'Note[]' is assignable to parameter of type 'Note'. Property 'id' is missing in type 'Note[]'</p>
  </blockquote>
  
  <p>The comple class code is :</p>
  
  <pre><code>export class HomePage {
  
    noteList: Observable&lt;Note[]&gt;
    myVar : Note[] = new Array();
  
    constructor(public navCtrl: NavController, private noteListService: NoteListService) {
      this.noteList = this.noteListService.getNoteList()
        .snapshotChanges()
        .map(
        changes =&gt; {
          return changes.map(c =&gt; ({
            key: c.payload.key, ...c.payload.val()
          }))
        });
    }
  
    this.noteList .forEach(value =&gt; this.myVar.push(value));
  
    //Then below, I want to use it in a Jquery 
  
    $(function() {
       // Also, I don't know how to access neither noteList nor myVar here. Any help here will be appreciated also
    }
  }
  </code></pre>
  
  <p>Could you guyz help be do this please...</p>