Waiting for a promise to resolve before function returns a value
<p>I'm trying to execute the following code: </p>

<pre><code>exports.myFunction = function(){
    myPromise.doThis().then(ret =&gt; {
     return ret;
    });
}
</code></pre>

<p>When calling this function it returns <code>undefined</code>. How do I make the function wait for the promise to resolve then return.</p>