@TUSHARLADVA Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
@Manoj1997 Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
If you call a fn that returns a Promise like this, do you have to have a .then with a resolve? Or if the fn call returns resolve/reject, it'll handle it?
return fnThatReturnsPromise()
.catch(...);
I don't need to do anything with the results of the fn, just for it to run successfully. So I don't need a .then but wasn't sure
And I want it to process that and return to the caller of this outer fn
the primary purpose of .then is to act as a sort of filter that modifies the existing promise
foo().then(doThis, orOnErrorDoThat); // returns a promise that resolves when `doThis` or `orOnErrorDoThat` resolves (based on whether foo resolved or rejected)