JavaScript-Developer-I Exam Question 16

developer wants to use a module named universalContainersLib and them call functions from it.
How should a developer import every function from the module and then call the functions foo and bar ?
  • JavaScript-Developer-I Exam Question 17

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

    A developer has the function, shown below, that is called when a page loads.

    Where can the developer see the log statement after loading the page in the browser?
  • JavaScript-Developer-I Exam Question 19

    Refer to the code below:
    console.log(''start);
    Promise.resolve('Success') .then(function(value){
    console.log('Success');
    });
    console.log('End');
    What is the output after the code executes successfully?
  • JavaScript-Developer-I Exam Question 20

    Refer to the code below:
    let car1 = new Promise((_ ,reject)=> setTimeout(reject,2000,"Car1 crashed in")); let car2 = new Promise(resolve => setTimeout(resolve,1500,"Car2 completed")); let car3 = new Promise(resolve => setTimeout(resolve,3000,"Car3 completed")); Promise.race([car1,car2,car3])
    .then(value=>{
    let result = `${value} the race.`;
    }).catch(err=>{
    console.log('Race is cancelled.',err);
    });
    What is the value of result when promise.race execues?