Question 66

Given the following code:
document.body.addEventListener(' click ', (event) => {
if (/* CODE REPLACEMENT HERE */) {
console.log('button clicked!');
)
});
Which replacement for the conditional statement on line 02 allows a developer to
correctly determine that a button on page is clicked?
  • Question 67

    A developer receives a comment from the Tech Lead that the code given below has
    error:
    const monthName = 'July';
    const year = 2019;
    if(year === 2019) {
    monthName = 'June';
    }
    Which line edit should be made to make this code run?
  • Question 68

    developer removes the HTML class attribute from the checkout button, so now it is simply:
    <button>Checkout</button>.
    There is a test to verify the existence of the checkout button, however it looks for a button with class= "blue". The test fails because no such button is found.
    Which type of test category describes this test?
  • Question 69

    A developer is trying to handle an error within a function.
    Which code segment shows the correct approach to handle an error without propagating it elsewhere?
    A)

    B)

    C)

    D)
  • Question 70

    Refer to the code below:
    Let foodMenu1 = ['pizza', 'burger', 'French fries'];
    Let finalMenu = foodMenu1;
    finalMenu.push('Garlic bread');
    What is the value of foodMenu1 after the code executes?