Question 91

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 92

    Refer to the code below:
    Function changeValue(obj) {
    Obj.value = obj.value/2;
    }
    Const objA = (value: 10);
    Const objB = objA;
    changeValue(objB);
    Const result = objA.value;
    What is the value of result after the code executes?
  • Question 93

    A developer creates a generic function to log custom messages in the console. To do this, the function below is implemented.
    01 function logStatus(status){
    02 console./*Answer goes here*/{'Item status is: %s', status};
    03 }
    Which three console logging methods allow the use of string substitution in line 02?
  • Question 94

    Given the following code:
    Let x =('15' + 10)*2;
    What is the value of a?
  • Question 95

    In the browser, the window object is often used to assign variables that require the broadest scope in an application Node.js application does not have access to the window object by default.
    Which two methods are used to address this ?
    Choose 2 answers