Question 16

Refer to the code snippet below:
Let array = [1, 2, 3, 4, 4, 5, 4, 4];
For (let i =0; i < array.length; i++)
if (array[i] === 4) {
array.splice(i, 1);
}
}
What is the value of array after the code executes?
  • Question 17

    Given the code below:
    const delay = sync delay => {
    Return new Promise((resolve, reject) => {
    setTimeout (resolve, delay);});};
    const callDelay =async () =>{
    const yup =await delay(1000);
    console.log(1);
    What is logged to the console?
  • Question 18

    Refer to the code below:
    Const resolveAfterMilliseconds = (ms) => Promise.resolve (
    setTimeout (( => console.log(ms), ms ));
    Const aPromise = await resolveAfterMilliseconds(500);
    Const bPromise = await resolveAfterMilliseconds(500);
    Await aPromise, wait bPromise;
    What is the result of running line 05?
  • Question 19

    Which three actions can be using the JavaScript browser console?
    Choose 3 answers:
  • Question 20

    Refer to the code below:
    01 const server = require('server');
    02 /* Insert code here */
    A developer imports a library that creates a web server. The imported library uses events and callbacks to start the servers Which code should be inserted at the line 03 to set up an event and start the web server ?