title: Array/List length is zero but Array is not empty
body: <p>When I console.log my array it shows that the length is zero. I checked that it was an array using <code>Array.isArray</code> which returned <code>true</code>. Also printed out the array values to make sure they exist and it shows in the console:</p>
  
  <pre><code>[]
  0: "a"
  1: "b"
  2: "c"
  3: "d"
  length: 4
  __proto__: Array(0)
  </code></pre>
  
  <p>I see that <code>__proto__: Array(0)</code> and I'm assuming this means it's a 0 length Array but how do I make it non-zero length so that I can iterate through it?</p>
  
  <p>A thought I had is that this function might be asynchronous but I'm not really sure how to work around that. </p>
  
  <p>Code for reference:</p>
  
  <pre><code>var list=[]
  //getting data from a database
  snapshot.forEach(function (node) {
     list.push(node.val())
     console.log(node.val()) //values print out
  })
  console.log(list) //array is length zero
  </code></pre>
  
  <p>I'm basically trying to add a for loop after this code to read through each value and use it for something else. However I can't iterate through the array because it registers as empty.</p>