I know that a thenable
has the then
method, but how does Promise
know the state of the thenable objected has moved to rejected?
Example: Here, $.ajax is a thenable and can be ducktyped as a Promise if you do this:
Promise.resolve($.ajax({ url: '/test' }))
But how does the promise that this expression returns handle the catch
case?