title: console.log returning pending promise, not actual data
body: <p>So I have this file:</p>
  
  <pre><code> 'use strict'
  import * as moment from "moment";
  import { Report} from "./Report";
  import { Timeframe} from "./Timeframe";
  import { ReportComparison } from "./ReportComparison";
  
  function test(firstFrom: string, firstTo: string, secondFrom: string, secondTo: string) {
  
  
      var pastReport = new Report(new Timeframe(moment(firstFrom), moment(firstTo)));
      var laterReport = new Report(new Timeframe(moment(secondFrom), moment(secondTo)));
  
      var reportComparison
  
      function getData(pastReport: Report, laterReport: Report) {
  
          var later = function() {
              return new Promise((resolve, reject) =&gt; {
                  laterReport.fetchData(data =&gt; resolve(data));
              });
          };
  
          var past = function() {
              return new Promise((resolve, reject) =&gt; {
                  pastReport.fetchData(data =&gt; resolve(data));
              });
          };
  
          return Promise.all([later(), past()]).then(() =&gt; {
              laterReport.sort();
              reportComparison = new ReportComparison(pastReport, laterReport);
  
              return {
                  pastReport: {
                      projects: reportComparison.pastReport.projects,
                      timeFrame: reportComparison.pastReport.timeframe,
                      totalAutomatedRuns: reportComparison.pastReport.totalAutomatedRuns,
                      totalManualRuns: reportComparison.pastReport.totalManualRuns
  
                  },
                  laterReport: {
                      projects: reportComparison.laterReport.projects,
                      timeFrame: reportComparison.laterReport.timeframe,
                      totalAutomatedRuns: reportComparison.laterReport.totalAutomatedRuns,
                      totalManualRuns: reportComparison.laterReport.totalManualRuns
                  },
                  trends: reportComparison.trends
              }
  
          });
  
      }
  
      return getData(pastReport, laterReport).then((res) =&gt; {
          return res;
      });
  
  }
  
  
  
  console.log(test("20170707", "20170707", "20170710", "20170710"))
  </code></pre>
  
  <p>Right now, the console.log returns <code>Promise { &lt;pending&gt; }</code> and not the actual value I want returned (the JSON object). Am I approaching this asynchronous code correctly? What solution could I use to return the JSON as a value, not a pending promise. </p>