title: Promise doesn't resolve the right value
body: <pre><code>function retRGObj(objName, xTime) {
      return new Promise(
          function (resolve, reject) {
              let data = {}
              findR(objName, xTime).then(function (msg) {
                  data.R = msg
                  console.log(data) //--&gt; saves the expected value
              }).then(findG(objName, xTime).then(function (msg) {
                  data.G = msg
                  console.log(data) //--&gt; saves the expected value
              }))
              console.log(data) //--&gt; all values are gone, returned value is "Object {}"
              resolve(data)
          })
  }
  </code></pre>
  
  <p>I don't know how I can not return the final value, it gets emptied in the last scope. How/why is it?</p>