title: Weird behavior with Promise throwing "Unhandled promise rejection" error
body: <p>When I run this code using Node, it throws an <code>Unhandled promise rejection</code> error in the console (even showing the <code>error caught</code> text first).</p>
  
  <pre><code>const promise = new Promise((resolve, reject) =&gt; setTimeout(reject, 1000))
  promise.then(() =&gt; console.log('ok'))
  promise.catch((e) =&gt; console.log('error caught'))
  </code></pre>
  
  <p>Nevertheless, when I chain the <code>catch</code> method to the <code>then</code> method, the error disappears:</p>
  
  <pre><code>const promise = new Promise((resolve, reject) =&gt; setTimeout(reject, 1000))
  promise.then(() =&gt; console.log('ok')).catch((e) =&gt; console.log('error caught'))
  </code></pre>
  
  <p>Isn't the first code supposed to handle the rejection?</p>
  
  <p>I also tried the first code in Chrome and it works if I open the inspector when I'm in a new tab (or google.com). If I'm in any other page (like stackoverflow.com) it throws the exception. Any explanation to this? This seems really weird to me!</p>