Promise.resolve with no argument passed in
<p>In the <a href="https://github.com/SAP/openui5/blob/master/src/sap.ui.table/src/sap/ui/table/Table.js#L1103" rel="noreferrer">OpenUI5 code-base</a> I came across this snippet:</p>

<pre><code>// Wait until everything is rendered (parent height!) before reading/updating sizes.
// Use a promise to make sure
// to be executed before timeouts may be executed.
Promise.resolve().then(this._updateTableSizes.bind(this, true));
</code></pre>

<p>It looks like the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" rel="noreferrer">native Promise function</a> is being used, with no argument being passed to it's <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/resolve" rel="noreferrer"><code>resolve</code></a> function which takes an:</p>

<blockquote>
  <p>Argument to be resolved by this Promise. Can also be a Promise or a
  thenable to resolve.</p>
</blockquote>

<p>So, since it looks like the promise would simply immediately resolve and invoke <code>then</code>'s callback, <em>perhaps</em> the intent is <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#Zero_delays" rel="noreferrer">similar to</a>:</p>

<pre><code>var self = this;
setTimeout(function() {
    self._updateTableSizes.bind(self, true)
}, 0);
</code></pre>

<p>...basically, freeing the JavaScript run-time event-loop to finish other things (like rendering) and then come right back to the callback?</p>

<p><strong>My question is:</strong></p>

<p>Is this a common pattern? Best-practice? Are there any advantages/disadvantages to either approach?</p>