title: Array with objects shows correctly in console, but is actually empty
body: <p>I am running into an issue with this code:</p>
  <pre><code>let productBuyDataArray = [];
      // productBuyData is a promise
      productBuyData.then(function(result) {
        for (let key in result) {
          productBuyDataArray.push({
            time: key,
            value: result[key],
          });
        }
      }
      );
  </code></pre>
  <p>when I <code>console.log(productBuyDataArray);</code>, it shows the data like I want it. But then when I try to use the data it is gone, the array is empty. I found out with <code>console.log(JSON.stringify(productBuyDataArray));</code> that it is indeed empty. Can someone help me with this?</p>