title: ES6 fetch function returns undefined
body: <p>I have the following code:</p>
  
  <pre><code>        function fetchDemo() {
              var result;
              fetch(countriesUrl).then(function(response) {
                  return response.json();
              }).then(function(json) {
                  result = json;
              });
  
              return result;
          }
  
          console.log(fetchDemo());
  </code></pre>
  
  <p>console.log(fetchDemo()) the following returns undefined. I need to use that value inside another function.</p>
  
  <p>The URL is "<a href="https://rawgit.com/csabapalfi/20d74eb83d0be023205225f79d3e7964/raw/7f08af5c0f8f411f0eda1a62a27b9a4ddda33397/countries.json" rel="noreferrer">https://rawgit.com/csabapalfi/20d74eb83d0be023205225f79d3e7964/raw/7f08af5c0f8f411f0eda1a62a27b9a4ddda33397/countries.json</a>" </p>