Question 51

Refer to the code below:
let sayHello = () => {
console.log ('Hello, world!');
};
Which code executes sayHello once, two minutes from now?
  • Question 52

    Refer to the code snippet:
    Function getAvailabilityMessage(item) {
    If (getAvailability(item)){
    Var msg ="Username available";
    }
    Return msg;
    }
    A developer writes this code to return a message to user attempting to register a new username. If the username is available, variable.
    What is the return value of msg hen getAvailabilityMessage ("newUserName" ) is executed and getAvailability("newUserName") returns false?
  • Question 53

    Refer to the code below:
    let o = {
    get js() {
    let city1 = String("st. Louis");
    let city2 = String(" New York");
    return {
    firstCity: city1.toLowerCase(),
    secondCity: city2.toLowerCase(),
    }
    }
    }
    What value can a developer expect when referencing o.js.secondCity?
  • Question 54

    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 55

    A test has a dependency on database.query. During the test the dependency is replaced with an object called database with the method, query, that returns an array. The developer needs to verify how many times the method was called and the arguments used each time.
    Which two test approaches describe the requirement?
    Choose 2 answers