Salesforce Certified JavaScript Developer (JS-Dev-101) JavaScript-Developer-I Question # 21 Topic 3 Discussion

Salesforce Certified JavaScript Developer (JS-Dev-101) JavaScript-Developer-I Question # 21 Topic 3 Discussion

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

Referto the code below:

new Promise((resolve, reject) => {

const fraction = Math.random();

if( fraction >0.5) reject("fraction > 0.5, " + fraction);

resolve(fraction);

})

.then(() =>console.log("resolved"))

.catch((error) => console.error(error))

.finally(() =>console.log(" when am I called?"));

JavaScript-Developer-I Question 21

When does Promise.finally on line 08 get called?


A.

When rejected


B.

When resolved and settled


C.

When resolved


D.

When resolved or rejected


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.