Which two promises are rejected?
A developer is wondering whether to use, Promise.then or Promise.catch, especially when a Promise throws an error?
Which two promises are rejected?
Which 2 are correct?
A . Promise.reject(‘cool error here’).then(error => console.error(error));
B . Promise.reject(‘cool error here’).catch(error => console.error(error));
C . New Promise((resolve, reject) => (throw ‘cool error here’}).catch(error => console.error(error)) ;
D . New Promise(() => (throw ‘cool error here’}).then(null, error => console.error(error)));
Answer: B,C
Latest JavaScript Developer I Dumps Valid Version with 144 Q&As
Latest And Valid Q&A | Instant Download | Once Fail, Full Refund
Subscribe
Login
0 Comments
Inline Feedbacks
View all comments