Question 46

Teams at Universal Containers (UC) work on multiple JavaScript projects at the same time.
UC is thinking about reusability and how each team can benefit from the work of others.
Going open-source or public is not an option at this time.
Which option is available to UC with npm?
  • Question 47

    A developer is setting up a new Node.js server with a client library that is built using events and callbacks.
    The library:
    * Will establish a web socket connection and handle receipt of messages to the server
    * Will be imported with require, and made available with a variable called we.
    The developer also wants to add error logging if a connection fails.
    Given this info, which code segment shows the correct way to set up a client with two events that listen at execution time?
  • Question 48

    Refer to the code below:
    01 const exec = (item, delay) =>{
    02 new Promise(resolve => setTimeout( () => resolve(item), delay)),
    03 async function runParallel() {
    04 Const (result1, result2, result3) = await Promise.all{
    05 [exec ('x', '100') , exec('y', 500), exec('z', '100')]
    06 );
    07 return `parallel is done: $(result1) $(result2)$(result3)`;
    08 }
    }
    }
    Which two statements correctly execute the runParallel () function?
    Choose 2 answers
  • Question 49

    A developer creates a generic function to log custom messages In the console. To do this, the function below is implemented.

    Which three console logging methods allow the use of string substitution in line 02?
    Choose 3 answers
  • Question 50

    Given the following code:
    document.body.addEventListener(' click ', (event) => {
    if (/* CODE REPLACEMENT HERE */) {
    console.log('button clicked!');
    )
    });
    Which replacement for the conditional statement on line 02 allows a developer to correctly determine that a button on page is clicked?