Javascript – Elegant way to chain two promises together and return the type of the second one?
I'm new to javascript and I have a question about promise chaining. I have two promises and want to return a promise that executes P2 after P1 regardless of whether P1 succeeded or failed, and return a Promise<number> as per…