Question 131

A developer wants to create an object from a function in the browser using the code below.
What happens due to lack of the new keyword on line 02?
  • Question 132

    A developer has code that calculates a restaurant bill, but generates incorrect answers
    while testing the code:
    function calculateBill ( items ) {
    let total = 0;
    total += findSubTotal(items);
    total += addTax(total);
    total += addTip(total);
    return total;
    }
    Which option allows the developer to step into each function execution within calculateBill?
  • Question 133

    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 ws.
    The developer also wants to add error logging if a connection fails.
    Given this information, which code segment show the correct way to set up a client two events that listen at execution time?
    A)

    B)

    C)

    D)
  • Question 134

    is below:
    <input type="file" onchange="previewFile()">
    <img src="" height="200" alt="Image Preview..."/>
    The JavaScript portion is:
    01 function previewFile(){
    02 const preview = document.querySelector('img');
    03 const file = document.querySelector('input[type=file]').files[0];
    04 //line 4 code
    05 reader.addEventListener("load", () => {
    06 preview.src = reader.result;
    07 },false);
    08 //line 8 code
    09 }
    In lines 04 and 08, which code allows the user to select an image from their local computer , and to display the image in the browser?
  • Question 135

    Refer to the code below:

    What is the value of result after line 10 executes?