Promise - difference between return reject or reject(value)
<p>I am new to promise and I am wondering which is the best practice with native Promise (NodeJs).</p>

<p>I put some code below to better understand the question:</p>

<p><strong>Code A</strong></p>

<pre><code>function foo(condition) {
return new Promise((resolve, reject) =&gt; {
    if(condition){
        resolve('Promise result!');
    } else {
        reject('Promise rejected!');
    }
});
} 
</code></pre>

<p><strong>Code B</strong></p>

<pre><code>function foo(condition) {
return new Promise((resolve, reject) =&gt; {
    if(condition){
        return resolve('Promise result!');
    } else {
        return reject('Promise rejected!');
    }
});
}
</code></pre>

<p>In solution B, I add the return statement.</p>

<p>Is it useful?</p>

<p>Which are the difference between <strong>Code A</strong> and <strong>Code B</strong>? If any?</p>