Which JavaScript statement results in changing “ Tony” to “Mr. T.”?

Refer to the HTML below: <div id=”main”> <ul> <li>Leo</li> <li>Tony</li> <li>Tiger</li> </ul> </div> Which JavaScript statement results in changing “ Tony” to “Mr. T.”?A . document.querySelectorAll(‘$main $TONY’).innerHTML = ’ Mr. T. ’;B . document.querySelector(‘$main li:second-child’).innerHTML = ’ Mr. T. ’;C . document.querySelector(‘$main li.Tony’).innerHTML = ’ Mr. T. ’;D . document.querySelector(‘$main...

September 24, 2024 No Comments READ MORE +

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.

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:...

September 23, 2024 No Comments READ MORE +

What should a developer insert at line 15 to output the following message using the method?

Given the code below: 01 function GameConsole (name) { 02 this.name = name; 3 } 4 5 GameConsole.prototype.load = function(gamename) { 6 console.log (` $(this.name) is loading agame: $(gamename) …`); 7 ) 8 function Console 16 Bit (name) { 9 GameConsole.call(this, name) ; 10 } 11 Console16bit.prototype = Object.create (GameConsole.prototype)...

September 23, 2024 No Comments READ MORE +

Which three console logging methods allow the use of string substitution in line 02?

A developer creates a genericfunction to log custom messages in the console. To do this, the function below is implemented. 01 function logStatus(status){ 02 console./*Answer goes here*/{‘Item status is: %s’, status}; 03 } Which three console logging methods allow the use of string substitution in line 02?A . AssertB ....

September 23, 2024 No Comments READ MORE +

05 account. Style.display = accountName.includes(parsedSearchString)?

Given the JavaScript below: 01 function filterDOM (searchString) { 02 const parsedSearchString = searchString && searchString.toLowerCase() ; 03 document.quesrySelectorAll(‘ .account’ ) . forEach(account => ( 04 const accountName = account.innerHTML.toLOwerCase(); 05 account. Style.display = accountName.includes(parsedSearchString)? /*Insert code*/; 6 )}; 7 } Which code should replace the placeholder comment on line...

September 23, 2024 No Comments READ MORE +

What happens due to lack of the new keyword on line 02?

A developer wants to create an object from a function in the browser using the code below: Function Monster() { this.name = ‘hello’ }; Const z = Monster(); What happens due to lack of the new keyword on line 02?A . The z variable is assigned the correct object.B ....

September 22, 2024 No Comments READ MORE +

What is the expected output?

Given the code below: FunctionmyFunction(){ A =5; Var b =1; } myFunction(); console.log(a); console.log(b); What is the expected output?A . Both lines 08 and 09 are executed, and the variables are outputted.B . Line 08 outputs the variable, but line 09 throws an error.C . Line 08thrones an error, therefore...

September 22, 2024 No Comments READ MORE +

What is the value of result when Promise.race executes?

catch( arr => ( 10 console.log(“Race is cancelled.”, err); 11 )); What is the value of result when Promise.race executes?A . Car 3 completed the race.B . Car 1 crashed in the race.C . Car 2 completed the race.D . Race is cancelled.View AnswerAnswer: C

September 22, 2024 No Comments READ MORE +

Which two results occur when running the test on the updated sum3 function?

A Developer wrote the following code to test a sum3 function that takes in an array of numbers and returns the sum of the first three number in the array, The test passes: Let res = sum2([1, 2, 3]); console.assert(res === 6 ); Res = sum3([ 1, 2, 3, 4]);...

September 22, 2024 No Comments READ MORE +

Without using any third-party libraries, what should the developer add to index.js to create the secure web server?

A developer wants to set up a secure web server withNode.js. The developer creates a directory locally called app-server, and the first file is app-server/index.js Without using any third-party libraries, what should the developer add to index.js to create the secure web server?A . const https =require(‘https’);B . const server...

September 22, 2024 No Comments READ MORE +