JavaScript-Developer-I Exam Question 16

A developer needs the function personalizeWebsiteContent to run when the webpage is fully loaded (HTML and all external resources).
Which implementation should be used?
  • JavaScript-Developer-I Exam Question 17

    A developer publishes a new version of a package with new features that do not break backward compatibility. The previous version number was 1.1.3.
    Following semantic versioning formats, what should the new package version number be?
  • JavaScript-Developer-I Exam Question 18

    Refer to the code:
    01 function execute() {
    02 return new Promise((resolve, reject) = > reject());
    03 }
    04 let promise = execute();
    05
    06 promise
    07 .then(() = > console.log( ' Resolved1 ' ))
    08 .then(() = > console.log( ' Resolved2 ' ))
    09 .then(() = > console.log( ' Resolved3 ' ))
    10 .catch(() = > console.log( ' Rejected ' ))
    11 .then(() = > console.log( ' Resolved4 ' ));
    What is the result when the Promise in the execute function is rejected?
  • JavaScript-Developer-I Exam Question 19

    Correct implementation of try...catch for countsDeep():
  • JavaScript-Developer-I Exam Question 20

    Refer to the code below:
    01 new Promise((resolve, reject) = > {
    02 const fraction = Math.random();
    03 if (fraction > 0.5) reject( ' fraction > 0.5, ' + fraction);
    04 resolve(fraction);
    05 })
    06 .then(() = > console.log( ' resolved ' ))
    07 .catch((error) = > console.error(error))
    08 .finally(() = > console.log( ' when am I called? ' ));
    When does Promise.finally on line 08 get called?