PromiseA().then(function(dataA){
if (dataA.foo == "skip me")
return ?? //break promise early - don't perform next then()
else
return PromiseB()
}).then(function(dataB){
console.log(dataB)
}).catch(function (e) {
//Optimal solution will not cause this method to be invoked
})
How can the above code be modified to break early (skip the 2nd then())?