JavaScript-Developer-I Exam Question 46

A developer has a server running with Node.js. the command to start the web server is node server.js. the server started having latency issues. Instead of a one second turnaround for web requests, the developer now sees a five second turnaround.
Which command can the web developer run to see what the module is doing during the latency period?
  • JavaScript-Developer-I Exam Question 47

    Refer to the code below:
    new Promise((resolve, reject) => {
    const fraction = Math.random();
    if( fraction >0.5) reject("fraction > 0.5, " + fraction);
    resolve(fraction);
    })
    .then(() =>console.log("resolved"))
    .catch((error) => console.error(error))
    .finally(() => console.log(" when am I called?"));

    When does Promise.finally on line 08 get called?
  • JavaScript-Developer-I Exam Question 48

    Refer to code below:
    function Person() {
    this.firstName = 'John';
    }
    Person.prototype ={
    Job: x => 'Developer'
    };
    const myFather = new Person();
    const result =myFather.firstName + ' ' + myFather.job();
    What is the value of the result after line 10 executes?
  • JavaScript-Developer-I Exam Question 49

    Given the following code:
    Let x =('15' + 10)*2;
    What is the value of a?
  • JavaScript-Developer-I Exam Question 50

    Refer to the code below:
    Const searchTest = 'Yay! Salesforce is amazing!" ;
    Let result1 = searchText.search(/sales/i);
    Let result 21 = searchText.search(/sales/i);
    console.log(result1);
    console.log(result2);
    After running this code, which result is displayed on the console?