Is there any differences between async/await, and more standard promise notations using .then
, .finally
, and .catch
for example
functionThatReturnsPromise(someVar).then((returnedValueFromPromise) => {
console.log(returnedValueFromPromise)
})
vs
async functionThatReturnsPromise(someVar) {
await returnedValueFromPromise
}
I'm unsure if Promise chaining is just the old notation, and it's been replaced by the newer async/await. Is there still a use case for both? What is better practice?