title: Break promise chain when condition is not met
body: <p>Hi I'm trying to do a simple thing, when a condition is not met don't go to the 3rd then. I know I can stop by placing a break statement to throw an error but is not the proper way to handle this, so I tried to call another function from outside to stop there without success:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>Promise.resolve("hello")
  .then((value)=&gt; { return value})
  .then(param=&gt; {
   if(typeof(param) === "number"){
     console.log(param)
      return
    }else{
     console.log("I'll be stuck here")
      return outside()
    }
  })
  
  .then(()=&gt;{
   console.log("inside 3rd promise")
  })
  
  function outside(){
   console.log("I'm outside")
    
  }</code></pre>
  </div>
  </div>
  </p>