JavaScript-Developer-I Exam Question 11

What is the result of the code block?
  • JavaScript-Developer-I Exam Question 12

    A developer wrote the following code:
    01 let X = object.value;
    02
    03 try {
    04 handleObjectValue(X);
    05 } catch (error) {
    06 handleError(error);
    07 }
    The developer has a getNextValue function to execute after handleObjectValue(), but does not want to execute getNextValue() if an error occurs.
    How can the developer change the code to ensure this behavior?
  • JavaScript-Developer-I Exam Question 13

    Refer to the following code that performs a basic mathematical operation on a provided input:
    function calculate(num) {
    Return (num +10) / 3;
    }
    How should line 02 be written to ensure that x evaluates to 6 in the line below?
    Let x = calculate (8);
  • JavaScript-Developer-I Exam Question 14

    Refer to the code below:
    Const myFunction = arr => {
    Return arr.reduce((result, current) =>{
    Return result = current;
    }, 10};
    }
    What is the output of this function when called with an empty array ?
  • JavaScript-Developer-I Exam Question 15

    Given the code below:
    const delay = sync delay => {
    Return new Promise((resolve, reject) => {
    setTimeout (resolve, delay);});};
    const callDelay =async () =>{
    const yup =await delay(1000);
    console.log(1);
    What is logged to the console?