title: Firebase realtime request inside map
body: <p>I have this javascript code</p>
  
  <pre><code>monthly = 0
  await Promise.all(
      second.map(uid =&gt; {
          firebase.database().ref('user').child(uid).once('value', u =&gt; {
              u = u.val()
              if (u.pack.name != 'no pack'){
                  monthly = monthly + 10
              }else{
                  monthly = monthly +3
              }
          })
      })
  ).then(() =&gt; {
      console.log(monthly)
  }
  </code></pre>
  
  <p>I need to use the variable monthly in the callback but i always get "0" as output       </p>