List of questions
Related questions
Question 102 - Certified JavaScript Developer I discussion
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)));
Your answer:
0 comments
Sorted by
Leave a comment first