Question 51

A developer creates a class that represents a blog post based on the requirement that a
Post should have a body author and view count.
The Code shown Below:
Class Post {
// Insert code here
This.body =body
This.author = author;
this.viewCount = viewCount;
}
}
Which statement should be inserted in the placeholder on line 02 to allow for a variable to be set
to a new instanceof a Post with the three attributes correctly populated?
  • Question 52

    Refer to the code below:
    Let searchString = ' Look for this ';
    Which two options remove the whitespace from the beginning of searchString? Choose 2 answers
  • Question 53

    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 54

    Which statement accurately describes the behavior of the async /swait keywords?
  • Question 55

    A developer writes the code below to calculate the factorial of a given number.

    What is the result of executing line 04?