Question 66

Refer to the following code:
01 function Tiger(){
02 this.Type = 'Cat';
03 this.size = 'large';
04 }
05
06 let tony = new Tiger();
07 tony.roar = () =>{
08 console.log('They\'re great1');
09 };
10
11 function Lion(){
12 this.type = 'Cat';
13 this.size = 'large';
14 }
15
16 let leo = new Lion();
17 //Insert code here
18 leo.roar();
Which two statements could be inserted at line 17 to enable the function call on line 18?
Choose 2 answers.
  • Question 67

    A developer implements and calls the following code when an application state change occurs:
    Const onStateChange =innerPageState) => {
    window.history.pushState(newPageState, ' ', null);
    }
    If the back button is clicked after this method is executed, what can a developer expect?
  • Question 68

    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 the array after the code executes?
  • Question 69

    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 70

    Refer to the code below:
    const event = new CustomEvent(
    //Missing Code
    );
    obj.dispatchEvent(event);
    A developer needs to dispatch a custom event called update to send information about recordId.
    Which two options could a developer insert at the placeholder in line 02 to achieve this?
    Choose 2 answers