Question 11

Given the code below:

What is logged to the console'
  • Question 12

    Refer to the following code:
    function test (val) {
    If (val === undefined) {
    return 'Undefined values!' ;
    }
    if (val === null) {
    return 'Null value! ';
    }
    return val;
    }
    Let x;
    test(x);
    What is returned by the function call on line 13?
  • Question 13

    Refer to the code below:
    01 let country = {
    02 get capital() {
    03 let city = Number( " London " );
    04
    05 return {
    06 cityString: city.toString(),
    07 }
    08 }
    09 }
    Which value can a developer expect when referencing country.capital.cityString?
  • Question 14

    Refer to the code below:

    A developer uses a client that makes a GET request that uses a promise to handle the request, getRequest returns a promise.
    Which code modification can the developer make to gracefully handle an error?
    A)

    B)

    C)

    D)
  • Question 15

    A developer wrote the following code to test a sum3 function that takes in an array of numbers and returns the sum of the first three numbers in the array. The test passes:
    01 let res = sum3([1, 2, 3]);
    02 console.assert(res === 6);
    03
    04 res = sum3([1, 2, 3, 4]);
    05 console.assert(res === 6);
    A different developer made changes to the behavior of sum3 to instead sum all of the numbers present in the array.
    Which two results occur when running the test on the updated sum3 function?