Which code should be inserted at the line 03 to set up an event and start the web server?

Refer to the code below: 01 const server = require(‘server’); 02 /* Insert code here */ A developer imports a library that creates a web server. The imported library uses events and callbacks to start the servers Which code should be inserted at the line 03 to set up an...

January 9, 2021 No Comments READ MORE +

Which option makes the code work as expected?

A developer is required to write a function that calculates the sum of elements in an array but is getting undefined every time the code is executed. The developer needs to find what is missing in the code below. Const sumFunction = arr => { Return arr.reduce((result, current) => {...

January 9, 2021 No Comments READ MORE +

Which two statements could be inserted at line 17 to enable the function call on line 18?

Refer to the following code: 01 function Tiger(){ 02 this.Type = ‘Cat’; 03 this.size = ‘large’; 04 } 05 06 let tony = new Tiger(); 07 tony.roar = () =>{ 08 console.log(‘They’re great1’); 9 }; 10 11 function Lion(){ 12 this.type = ‘Cat’; 13 this.size = ‘large’; 14 } 15...

January 9, 2021 No Comments READ MORE +

Given the code above, which three properties are set pet1?

Refer to the code: Given the code above, which three properties are set pet1? Choose 3 answers:A . NameB . canTalkC . TypeD . OwnerE . SizeView AnswerAnswer: B,C,E

January 9, 2021 No Comments READ MORE +

What is the output line 11?

Refer to the following code: Let obj ={ Foo: 1, Bar: 2 } Let output =[], for(let something in obj{ output.push(something); } console.log(output); What is the output line 11?A . [1,2]B . [“bar”,”foo”]C . [“foo”,”bar”]D . [“foo:1”,”bar:2”]View AnswerAnswer: C

January 9, 2021 No Comments READ MORE +

Which option is a core Node,js module?

Which option is a core Node,js module?A . PathB . IosC . MemoryD . locateView AnswerAnswer: A

January 9, 2021 No Comments READ MORE +

If the back button is clicked after this method is executed, what can a developer expect?

A developer implements and calls the following code when an application state change occurs: Const onStateChange =innerPageState) => { window.history.pushState(newPageState, ‘ ’, null); } If the back button is clicked after this method is executed, what can a developer expect?A . A navigate event is fired with a state property...

January 8, 2021 No Comments READ MORE +

Which three statements are true about promises? Choose 3 answers

Which three statements are true about promises? Choose 3 answersA . The executor of a new Promise runs automatically.B . A Promise has a .then() method.C . A fulfilled or rejected promise will not change states .D . A settled promise can become resolved.E . A pending promise can become...

January 7, 2021 No Comments READ MORE +

Which command can the web developer run to see what the module is doing during the latency period?

developer has a web server running with Node.js. The command to start the web server is node server,js. The web server started having latency issues. Instead of a one second turn around for web requests, the developer now sees a five second turnaround, Which command can the web developer run...

January 7, 2021 2 Comments READ MORE +

In which situation should a developer include a try .. catch block around their function call?

In which situation should a developer include a try .. catch block around their function call?A . The function has an error that should not be silenced.B . The function results in an out of memory issue.C . The function might raise a runtime error that needs to be handled.D...

January 7, 2021 No Comments READ MORE +