Pre-Summer Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: validbest

Exam JavaScript-Developer-I All Questions
Exam JavaScript-Developer-I All Questions

View all questions & answers for the JavaScript-Developer-I exam

Salesforce Developer JavaScript-Developer-I Question # 24 Topic 3 Discussion

JavaScript-Developer-I Exam Topic 3 Question 24 Discussion:
Question #: 24
Topic #: 3

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 errorhere’).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)));


Get Premium JavaScript-Developer-I Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.