Question 41

Refer to the following array:
Let arr1 = [ 1, 2, 3, 4, 5 ];

Which two lines of code result in a second array, arr2 being created such that arr2 is not a reference to arr1?
  • Question 42

    A developer creates an object where its properties should be immutable and prevent properties from being added or modified.
    Which method should be used to execute this business requirement?
  • Question 43

    Refer to the following array:
    Let arr1 = [1, 2, 3, 4, 5];
    Which two lines of codes result in a second array, arr2, being created such that arr2 is not a reference to arr1? Choose 2 answers
  • Question 44

    Refer to the code below:

    What is the value result after line 10 executes?
  • Question 45

    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?