Question 71

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 72

    Refer to the following code:

    What is the value of output on line 11?
  • Question 73

    Given the following code:
    let x = null;
    console.log(typeof x);
    What is the output?
  • Question 74

    Refer to the following code block:
    class Animal{
    constructor(name){
    this.name = name;
    }
    makeSound(){
    console.log(`${this.name} is making a sound.`)
    }
    }
    class Dog extends Animal{
    constructor(name){
    super(name)
    this.name = name;
    }
    makeSound(){
    console.log(`${this.name} is barking.`)
    }
    }
    let myDog = new Dog('Puppy');
    myDog.makeSound();
    What is the console output?
  • Question 75

    developer creates a new web server that uses Node.js. It imports a server library that uses events and callbacks for handling server functionality.
    The server library is imported with require and is made available to the code by a variable named server. The developer wants to log any issues that the server has while booting up.
    Given the code and the information the developer has, which code logs an error at boost with an event?