title: lose the last element of the array in for loop
body: <p>When I execute this code, the last element of the array is lost or why? Why does this happen, will it be because it is an asynchronous function?
  <a href="https://i.stack.imgur.com/MRULb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MRULb.png" alt="console log"></a></p>
  
  <pre><code>async  getRow(){
    const user =  firebase.auth().currentUser
  var itemsRef =  Metodos.getRef().child('Amigos/'+user.uid);
   itemsRef.on('value', async (snapshot) =&gt;{
  
    let items =  [];
  
    childs = snapshot.val();
    for(child in childs){
      local = await Metodos.getLocal('-Ky7eG2rueIq47GUa7v5');
      firebase.database().ref().child('usuario/'+child).on('value',  (snap) =&gt;{
      datos =  snap.val();
  
           items.push({
          nombre: datos.nombre,
          imagen: datos.imagen
  
        })
  
  
     })
  
  
  
    }
    this.setState({
      amigos: items
    })
  
  
  
  });
  
  
  
  }
  </code></pre>