title: promise.then() returns Promise { <pending> }
body: <p>Function fetchData returns a promise and then I'm dealing with that promise in generateURL function by chaining the <code>promise</code> with <code>.then</code> however it returns Promise &lt; pending &gt;. Function generateURL should return a string What am I doing wrong?</p>
  <pre><code>const fetch = require('node-fetch');
  
  const fetchData = async () =&gt; {
    return await fetch('https://jsonplaceholder.typicode.com/todos/1');
  };
  
  const generateURL = () =&gt; {
    const baseURL = 'https://cdn.test.com/';
    fetchData().then((res) =&gt; {
      const data = res.json();
      console.log('data', data);
      const id = data.id;
      console.log('id', id);
      const generatedURL = `${baseURL}${id}`;
      return generatedURL;
    });
  };
   
  </code></pre>