Why is catch function called twice on the same promise?
I’m trying to understand how promises work under the hood in JS and faced with this example:
Why is catch function called twice on the same promise?
I’m trying to understand how promises work under the hood in JS and faced with this example:
console.log write parameter from function as undefined
I use the following code to get AWS ECS status. But while try to debug I recognized that
serviceName is always “undefined”. Why?
It seems that the AWS SDK functions inside this codeblock use serviceName with the correct value.
a question about then handler of a promise with a setTimeout inside the promise
I have this piece of code:
a question about then handler of a promise with a setTimeout inside the promise
I have this piece of code:
Async/Await not working correctly for custom version of Promise.allSettled in NodeJs
I am working on custom implementation of Promise.allSettled in NodeJs. When I implement using Promise.then it works perfectly. But when I implement using Async/Await it throw the error.
Cannot cancel the promise chain
I am new to Javascript now and trying to learn it. The firstPromise will reject and run the catch
instead of then
. Now, I want it to skip all the other then
‘s and goes to finally
.
Why does my promise go from fulfilled to pending?
First my promise is fulfilled, then after I return it from a function it goes to pending when I log the status of the promise. Why is this?:
can not setTimeout with Promise
I was trying to use Promise to test different ways of using Promise then i encountered this problems: