View all questions & answers for the JavaScript-Developer-I exam
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?
Promise.reject(‘cool errorhere’).then(error => console.error(error));
Promise.reject(‘cool error here’).catch(error => console.error(error));
New Promise((resolve, reject) => (throw ‘cool error here’}).catch(error =>console.error(error)) ;
New Promise(() => (throw ‘cool error here’}).then(null, error => console.error(error)));
Submit