Question 46
A developer is creating a simple webpage with a button. When a user clicks this button for the first time, a message is displayed.
The developer wrote the JavaScript code below, but something is missing. The message gets displayed time a user clicks the button instead of just the first time.

Which two code lines make this code work as required? Choose 2 answers
The developer wrote the JavaScript code below, but something is missing. The message gets displayed time a user clicks the button instead of just the first time.

Which two code lines make this code work as required? Choose 2 answers
Question 47
Refer to the following array:
Let arr1 = [1, 2, 3, 4, 5];
Which two lines of codes result in a second array, arr2, being created such that arr2 is not a reference to arr1? Choose 2 answers
Let arr1 = [1, 2, 3, 4, 5];
Which two lines of codes result in a second array, arr2, being created such that arr2 is not a reference to arr1? Choose 2 answers
Question 48
Refer to the code below:
01 const exec = (item, delay) =>{
02 new Promise(resolve => setTimeout( () => resolve(item), delay)),
03 async function runParallel() {
04 Const (result1, result2, result3) = await Promise.all{
05 [exec ('x', '100') , exec('y', 500), exec('z', '100')]
06 );
07 return `parallel is done: $(result1) $(result2)$(result3)`;
08 }
}
}
Which two statements correctly execute the runParallel () function?
Choose 2 answers
01 const exec = (item, delay) =>{
02 new Promise(resolve => setTimeout( () => resolve(item), delay)),
03 async function runParallel() {
04 Const (result1, result2, result3) = await Promise.all{
05 [exec ('x', '100') , exec('y', 500), exec('z', '100')]
06 );
07 return `parallel is done: $(result1) $(result2)$(result3)`;
08 }
}
}
Which two statements correctly execute the runParallel () function?
Choose 2 answers
Question 49
Universal Containers recently launched its new landing page to host a crowd-funding
campaign. The page uses an external library to display some third-party ads. Once the page is
fully loaded, it creates more than 50 new HTML items placed randomly inside the DOM, like the
one in the code below:

All the elements includes the same ad-library-item class, They are hidden by default, and they are randomly displayed while the user navigates through the page.
campaign. The page uses an external library to display some third-party ads. Once the page is
fully loaded, it creates more than 50 new HTML items placed randomly inside the DOM, like the
one in the code below:

All the elements includes the same ad-library-item class, They are hidden by default, and they are randomly displayed while the user navigates through the page.
Question 50
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 personaliseContext
needs to be executed when the webpage is fully loaded (HTML content and all related files ), in
order to do some custom initialization.
Which statement should be used to call personalizeWebsiteContent based on the above
business requirement?
JavaScript TO ensure that visitors have a good experience, a script named personaliseContext
needs to be executed when the webpage is fully loaded (HTML content and all related files ), in
order to do some custom initialization.
Which statement should be used to call personalizeWebsiteContent based on the above
business requirement?