Question 71

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 72

    Refer to the code below:
    Const pi w 3.1415926;
    What is the data type of pi?
  • Question 73

    Consider type coercion, what does the following expression evaluate to?
    True + 3 + '100' + null
  • Question 74

    Which statement accurately describes an aspect of promises?
  • Question 75

    Refer to the following code:

    What is returned by the function call on line 13?