JavaScript-Developer-I Exam Question 71

Refer to the code below:
let car1 = new Promise((_ ,reject)=> setTimeout(reject,2000,"Car1 crashed in")); let car2 = new Promise(resolve => setTimeout(resolve,1500,"Car2 completed")); let car3 = new Promise(resolve => setTimeout(resolve,3000,"Car3 completed")); Promise.race([car1,car2,car3])
.then(value=>{
let result = `${value} the race.`;
}).catch(err=>{
console.log('Race is cancelled.',err);
});
What is the value of result when promise.race execues?
  • JavaScript-Developer-I Exam Question 72

    A developer wants to create an object from a function in the browser using the code below.

    What happens due to the lack of the mm keyword on line 02?
  • JavaScript-Developer-I Exam Question 73

    Refer to the code below:
    01 let car1 = new promise((_, reject) =>
    02 setTimeout(reject, 2000, "Car 1 crashed in"));
    03 let car2 = new Promise(resolve => setTimeout(resolve, 1500, "Car 2
    completed"));
    04 let car3 = new Promise(resolve => setTimeout (resolve, 3000, "Car 3
    Completed"));
    05 Promise.race([car1, car2, car3])
    06 .then(value => (
    07 let result = $(value) the race. `;
    08 ))
    09 .catch( arr => (
    10 console.log("Race is cancelled.", err);
    11 ));
    What is the value of result when Promise.race executes?
  • JavaScript-Developer-I Exam Question 74

    Refer to the code below:
    Let textValue = '1984';
    Which code assignment shows a correct way to convert this string to an integer?
  • JavaScript-Developer-I Exam Question 75

    Given the following code:

    What is the output of line 02?