Returning data from a .then()
always results in the passing back of an object promise because .then()
always returns a promise. Even if the callback function inside the .then()
returns a non-promise value, it will still be wrapped in a promise object before being returned. This ensures consistency in the way promises are handled and allows for more seamless chaining of multiple promises together.
Asked: 2023-07-09 21:21:17 +0000
Seen: 15 times
Last updated: Jul 09 '23