title: How can I synchronously determine a JavaScript Promise's state?
body: <p>I have a pure JavaScript Promise (built-in implementation or poly-fill):</p>
  
  <p><code>var promise = new Promise(function (resolve, reject) { /* ... */ });</code></p>
  
  <p>From the <a href="http://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects" rel="noreferrer">specification</a>, a Promise can be one of:</p>
  
  <ul>
  <li>'settled' and 'resolved'</li>
  <li>'settled' and 'rejected'</li>
  <li>'pending'</li>
  </ul>
  
  <p>I have a use case where I wish to interrogate the Promise synchronously and determine:</p>
  
  <ul>
  <li><p>is the Promise settled?</p></li>
  <li><p>if so, is the Promise resolved?</p></li>
  </ul>
  
  <p>I know that I can use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then" rel="noreferrer"><code>#then()</code></a> to schedule work to be performed asynchronously after the Promise changes state. I am NOT asking how to do this.</p>
  
  <p>This question is specifically about <strong>synchronous interrogation of a Promise's state</strong>. How can I achieve this?</p>