title: Properly getting the value of a JSON field from a JavaScript Promise object
body: <p>I'm making a call to a url and trying to get the data as JSON, which I've basically copied from other answers on StackOverflow. However, responseData.title has two different values in the two calls I make in the second <code>.then()</code> call below:</p>
  
  <pre><code>var getTitleForId = async function(id) {
      if (!id)
          return false
  
      let url = id + "other stuff to make a valid api call"
  
      let response = '(null)'
  
      await fetch(url)
          .then((resp) =&gt; resp.json())
          .then((responseData) =&gt; {
              console.log(responseData.title);
              response = responseData.title;
      })
  
      return response
  }
  </code></pre>
  
  <p>In the first call, <code>console.log(responseData.title)</code>, the log shows the title field from the json response.</p>
  
  <p>In the second call, <code>response = responseData.title</code> (which is later returned in the method) assigns <code>[object Promise]</code> to <code>response</code> which I assume is a Promise's <code>toString()</code></p>
  
  <p>I'm not even going to pretend JavaScript is my forte, so if I'm missing something trivial, sorry in advance.</p>
  
  <p>Edit: By "second call" I mean the second time I access. If you looked at the code now, what I mean is that when I return response, which I would have assumed would be assigned <code>responseData.title</code>, it is instead assigned <code>[object Promise]</code></p>
  
  <p>Edit2: Also I realize that '(null)' will never be passed on, regardless of what happens. It's just a leftover from one of the many times I've tried to make this work.</p>
  
  <p>Edit3: I added the entire body of the method</p>