Question 66

Refer to 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?"));

When does Promise.finally on line 08 get called?
  • Question 67

    Universal Container (UC) notices that its application allows users to search for account makes a network request each time a key is pressed. This results in too many request for the server to handle.
    O address this problem, UC decides to implement a deboune function on the search string change handler. Choose 3 answers
  • Question 68

    A developer is working on an ecommerce website where the delivery date is dynamically calculated based on the current day. The code line below is responsible for this calculation.
    Const deliveryDate = new Date ();
    Due to changes in the business requirements, the delivery date must now be today's date + 9 days.
    Which code meets this new requirement?
  • Question 69

    Refer to the code below:
    Const resolveAfterMilliseconds = (ms) => Promise.resolve (
    setTimeout (( => console.log(ms), ms ));
    Const aPromise = await resolveAfterMilliseconds(500);
    Const bPromise = await resolveAfterMilliseconds(500);
    Await aPromise, wait bPromise;
    What is the result of running line 05?
  • Question 70

    A test has a dependency on database. query. During the test, the dependency is replaced with an object called database with the method, Calculator query, that returns an array. The developer does not need to verify how many times the method has been called.
    Which two test approaches describe the requirement?
    Choose 2 answers