JavaScript-Developer-I Exam Question 36

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 37

    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
  • JavaScript-Developer-I Exam Question 38

    Refer to the following code that imports a module named utils:
    import (foo, bar) from '/path/Utils.js';
    foo() ;
    bar() ;
    Which two implementations of Utils.js export foo and bar such that the code above runs without error?
    Choose 2 answers
  • JavaScript-Developer-I Exam Question 39

    The developer wants to test the array shown:
    const arr = Array(5).fill(0)
    Which two tests are the most accurate for this array ?
    Choose 2 answers:
  • JavaScript-Developer-I Exam Question 40

    Refer to following code block:
    Let array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,];
    Let output =0;
    For (let num of array){
    if (output >0){
    Break;
    }
    if(num % 2 == 0){
    Continue;
    }
    Output +=num;
    What is the value of output after the code executes?