title: How to get multiple fetch functions execute in order?
body: <p>I created an IG like button where the number of like changes after a click. I added 2 fetch functions - one with PUT. I tried multiple ways but the results are same - the GET fetch is getting executed first. How can I prevent that?</p>
  <pre><code>function liking(tweetid) {
  
      let l = document.querySelector('#numlikes-' + tweetid);
  
      fetch(`tweets/${tweetid}`, {
          method: 'PUT',
          body: JSON.stringify({
              tweet_like: 1
          })
      });
      
      fetch(`tweets/${tweetid}`)
      .then(response =&gt; response.json())
      .then(post =&gt; {
          l.innerHTML = post.likes;
      });
  
  }
  </code></pre>