title: Unable to resolve a Promise calling another method
body: <p>I am unable to resolve a Promise that is created. Not sure where the problem is, please help me to resolve this.</p>
  <pre><code>const tsearch = async () =&gt; {
      console.log(&quot;calling&quot;)
      //requesting the relevant page data
      await new Promise((resolve) =&gt;  {
          getData(&quot;wifi&quot;, 2, true); 
          return resolve(&quot;success&quot;)
      });
      console.log(finished);
  }
  
  function getData(url, callControl = 0, wifi = false) {
      if (!!url) {
          console.log(url + &quot; - &quot; + callControl)
      }
      if (callControl &gt; 0)
      setTimeout(getData, 1000, url, --callControl)
      else {
          console.log(&quot;getData - else part - resolving&quot;)
          // Promise.resolve();
      }
  }
  
  
  tsearch();
  </code></pre>