title: Getting JavaScript promise value
body: <p>I have a json file I am trying to read the contents of for use in a script. I am using the following to fetch json:</p>
  
  <pre><code>const json = fetch('Data/my_data.json').then(response =&gt; response.json());
  </code></pre>
  
  <p>When I do this and I look at the json object in the console I see it is a returned promise (resolved status) containing the actual json object from the file. You can't directly access the promisevalue though. you have to use a then statement again so I used this:</p>
  
  <pre><code>json.then(function(getData){metaData = getData;});
  </code></pre>
  
  <p>The metaData object is not set to the value of the original promise. It is unset until a later time when the 2nd then completes. The information is already available though in the originally returned promise.</p>
  
  <p>Is it possible to get the original promisevalue without the 2nd then statement or
  am I accessing the promise incorrectly with the 2nd then statement.</p>
  
  <p>Thanks for any insight!  </p>