2 ms·
Hi Jake! That is exactly what the code in the article does, isn't it? promise.catch(() => {}) It does follow up with "this doesn't change the promises ot
by ricardobeat 4y ago
Hi Jake! That is exactly what the code in the article does, isn't it?
promise.catch(() => {})
It does follow up with "this doesn't change the promises other than marking them as 'handled'. They're still rejected promises" but that doesn't seem right - they become fulfilled promises with a value of undefined, and those values will definitely show up in the for loop later. Is there something I'm missing with the nested promises?
My suggestion was in the spirit of keeping this behaviour the same, except I think explicitly adding the catch handler to fetch() is the right way to do it vs an auxiliary function to 'silence' them.
- jaffathecake 4y ago> they become fulfilled promises with a value of undefined No they don't, which is why I made that clarification in the post :D const promise1 = Promise.reject(Error("wow")); // promise1 is rejected, and unhandled const promise2 = promise1.catch(() => {}); // promise2 will be fulfilled, and is unhandled // promise1 is still rejected, but now handled