When chaining Promises, returning a non-Promise value from a .then() handler will cause the next .then() in the chain to receive a Promise resolved with that ________.
- Error
- Value
- Promise
- Rejection
When you return a non-Promise value (a regular value) from a .then() handler, the next .then() in the chain will receive a Promise that is resolved with that value. This allows you to pass values between Promise chain steps.
Loading...
Related Quiz
- In what scenarios would using spies be preferable over mocks and stubs?
- You are developing a JavaScript library that will be used by other developers. How can ESLint help in ensuring that the code is error-free and adheres to best practices before being published?
- How can you optimize the performance of a SQL query that reads a large amount of data?
- You are developing an Express.js application and you realize that some of the errors are not being caught by your error-handling middleware. What should you consider while debugging this issue?
- You are tasked with improving the performance of a database that experiences heavy read and write operations. How would you balance the use of indexing to improve read performance while minimizing the impact on write performance?