title: How to retrieve data from Firebase to pass into an array in angularfire2/version-5
body: <p>I have some simple entries in Firebase like:</p>
  <p><a href="https://i.stack.imgur.com/KJxqD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KJxqD.png" alt="this structure" /></a></p>
  <p>All I want is, to get these values (each percentage) and pass them into an array called <em>labels</em>. so that I can use that array in my code. That is my question.</p>
  <p>Now, to me, it seemed easy but apparently it is not.</p>
  <p>First of all what I faced is <strong>@angularfire</strong> version 5 differences in the examples(but easy to understand in their GitHub docs).
  so secondly, I try to get data with:</p>
  <pre><code>this.items = db.list('/percentage').valueChanges();
  </code></pre>
  <p>so I do it and check it on the console.
  <a href="https://i.stack.imgur.com/Xr14n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Xr14n.png" alt="this is what I get" /></a></p>
  <p>then I check out other questions on SO and thirdly, in examples, I am told 'its asynchronous data so you should subscribe to it' I do subscribe and again log it in the console to see how my array would look like. <a href="https://i.stack.imgur.com/YSZiT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YSZiT.png" alt="and this is what I get" /></a>
  and of course, after that I check out more examples and oh, turns out I should <strong>map()</strong> it. then I do it with</p>
  <pre><code>this.labels = db.list('/percentage').valueChanges().map(res =&gt; this.labels = res);
  </code></pre>
  <p>:<a href="https://i.stack.imgur.com/7E8wV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7E8wV.png" alt="and I get this" /></a></p>
  <p>I don't get any errors but I can't figure out a way to get this data as an array which would work for me.
  I would be really glad if someone explain a way to me.
  Thank you</p>