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

    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 43

    At Universal Containers, every team has its own way of copying JavaScript objects. The code snippet shows an Implementation from one team:

    What is the output of the code execution?
  • Question 44

    Which code statement correctly retrieves and return an object from localStorage?
    A)

    B)

    C)

    D)
  • Question 45

    Refer to the code below:
    let productSKU = '8675309,;
    A developer has a requirement to generate SKU numbers that are always 10 characters log, starting with 'sku', and padded with zeros.
    Which statement assigned the value skuooooooooo86675309?