Which method should be used to handle the rejection of a Promise?
- reject()
- catch()
- error()
- failure()
To handle the rejection of a Promise, you should use the catch() method. It allows you to specify what to do when the Promise is rejected with an error. The other options are not standard methods for handling Promise rejection in JavaScript.
Loading...
Related Quiz
- How does denormalization in database schema design affect data redundancy and read performance?
- How does JavaScript handle implicit data type conversion?
- When configuring the static files directory in Express.js, the path specified is relative to the ______ directory.
- The spread operator can effectively be used to create a shallow ______ of an object or an array.
- Which of the following array methods does not mutate the original array in JavaScript?