JavaScript-Developer-I Exam Question 1

A developer wrote the following code to test a sum3 function that takes in an array of numbers and returns the sum of the first three numbers in the array. The test passes:

A different developer made changes to the behavior of sum3 to instead sum all of the number present In the array.
Which two results occur when running the test on the updated sum3 function?
Choose 2 answers
  • JavaScript-Developer-I Exam Question 2

    developer uses the code below to format a date.

    After executing, what is the value offormattedDate?
  • JavaScript-Developer-I Exam Question 3

    A developer is working on an ecommerce website where the delivery date is dynamically calculated based on the current day. The code line below is responsible for this calculation.
    Const deliveryDate = new Date ();
    Due to changes in the business requirements, the delivery date must now be today's date + 9 days.
    Which code meets this new requirement?
  • JavaScript-Developer-I Exam Question 4

    A developer is wondering whether to use, Promise.then or Promise.catch, especially when a Promise throws an error?
    Which two promises are rejected?
    Which 2 are correct?
  • JavaScript-Developer-I Exam Question 5

    Refer to the code snippet:
    Function getAvailabilityMessage(item) {
    If (getAvailability(item)){
    Var msg ="Username available";
    }
    Return msg;
    }
    A developer writes this code to return a message to user attempting to register a new username. If the username is available, variable.
    What is the return value of msg hen getAvailabilityMessage ("newUserName" ) is executed and getAvailability("newUserName") returns false?