title: Value undefined returned from fetch (promise)
body: <p>I think i'm not understanding promises correctly. What I understand is that <code>fetch()</code> returns a promise, I try to use the <code>.then()</code> to return the value in the promise, but i always get undefined. What additionally confuses me is that I can <code>console.log()</code> and it shows data, but when I try to use it elsewhere it returns <code>undefined</code>. What am I doing wrong here?</p>
  
  <pre><code>var getData = function(){
  
      var getRaceData = function()
      {
          fetch('http://ergast.com/api/f1/2008.json')
          .then(function(response) {
              response.json().then(function(data) {
                  var raceSeason = data.MRData.RaceTable; 
                  var raceData = raceSeason.Races;
                  console.log(raceData);
                  // Not returning racedata here, always get undefined
                  return raceData;
              });
              }
          )
          .catch(function(err) {
              return;
          });
      }
  
  
  }
  </code></pre>