title: How to take the value of a variable inside the curly braces?
body: <p>I need the value of <code>that.assigned</code> outside the forEach but it would result with <code>undefined</code> if I ever use it as <code>console.log(that.assigned)</code> which is an array</p>
  
  <pre><code>assignedDoctors.then(function(doc){
    let i = 0;
    doc.forEach(function(md){
      tmpMDs.push(md.data());
      tmpMDs[i].key = md.id;
      // tmpMDs.push(md.data().push());
      i++;
    });
    that.assigned = tmpMDs;
  }).catch(function(e){
    console.log(e);
  });
  
  console.log(that.assigned)
  </code></pre>