skip to Main Content

Javascript – Nested Promises Execution Order

I was reading about nested promises and encountered this coding challenge in the tutorials. Can someone explain the execution order of this code? new Promise((resolve) => { new Promise((res) => { console.log("c"); resolve(3); res(2); }).then((response) => console.log(response)) }).then((res) => console.log(res));…

VIEW QUESTION

Javascript – States of a promise – resolved vs fulfilled – Is a thenable object always resolved?

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then#description Thenable objects that arise along the then() chain are always resolved — the onFulfilled handler never receives a thenable object, and any thenable returned by either handler are always resolved before being passed to the next handler. This is…

VIEW QUESTION
Back To Top
Search