What will happen when return new Promise((resolve, reject) => {}) forgot to call either resolve or reject? [duplicate]
This question already has an answer here: Are JavaScript forever-pending promises bad? 2 answers The problem is like this function demo() { return new Promise((resolve, reject) => { ... // The problem here!! //I just found in some rare case we failed to call resolve or reject }) } demo() .then(res => { console.log('resolve') console.log(res) }) .catch(rej => { console.log('reject') console.log(rej) }) .finally(() => { console.log('why') }) When I failed to call resolve or reject, even the finally block is not called! Why ? I had thought it was a bug then I found the original author seemed to