Summer Sale Limited Time 75% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code = simple75
Pass the Salesforce Developer JavaScript-Developer-I Questions and answers with Dumpstech
A developer at Universal Containers creates a new landing page based on HTML, CSS, and JavaScript.
To ensure that visitors have a good experience, a script named personalizeWebsiteContent needs to be executed to do some custom initialization when the webpage is fully loaded with HTML content and all related files.
Which statement should be used to call personalizeWebsiteContent based on the above business requirement?
Given the following code:
01 counter = 0;
02 const logCounter = () = > {
03 console.log(counter);
04 };
05 logCounter();
06 setTimeout(logCounter, 2100);
07 setInterval(() = > {
08 counter++;
09 logCounter();
10 }, 1000);
What will be the first four numbers logged?
Universal Containers (UC) just launched a new landing page, but users complain that the website is slow. A developer found some functions that might cause this problem. To verify this, the developer decides to execute everything and log the time each of these three suspicious functions consumes.
01 console.time( ' Performance ' );
02
03 maybeAHeavyFunction();
04
05 thisCouldTakeTooLong();
06
07 orMaybeThisOne();
08
09 console.endTime( ' Performance ' );
Which function can the developer use to obtain the time spent by every one of the three functions?
Refer to the code below:
< html >
< body >
< div id= " logo " > Hello Logo! < /div >
< button id= " test " > Click me < /button >
< /body >
< script >
function printMessage(event) {
console.log( ' This is a test message ' );
}
let el = document.getElementById( ' test ' );
el.addEventListener( " click " , printMessage, false);
< /script >
< /html >
Which action should be done?
A developer has a module that contains multiple functions.
What kind of export should be leveraged so that multiple functions can be used?
Refer to the code below:
01 const objBook = {
02 title: ' JavaScript ' ,
03 };
04 Object.preventExtensions(objBook);
05 const newObjBook = objBook;
06 newObjBook.author = ' Robert ' ;
What are the values of objBook and newObjBook respectively?
Refer to the code below:
let strNumber = ' 12345 ' ;
Which code snippet shows a correct way to convert this string to an integer?
Refer to the code declarations below:
let str1 = ' Java ' ;
let str2 = ' Script ' ;
Which three expressions return the string JavaScript?
Refer to the following code:
01 let obj = {
02 foo: 1,
03 bar: 2
04 }
05 let output = []
06
07 for (let something of obj) {
08 output.push(something);
09 }
10
11 console.log(output);
What is the value of output on line 11?
A developer needs the function personalizeWebsiteContent to run when the webpage is fully loaded (HTML and all external resources).
Which implementation should be used?