Summer Sale Special - Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: sntaclus

A team at Universal Containers works on a big project and uses yarn to manage the project ' s dependencies.

A developer added a dependency to manipulate dates and pushed the updates to the remote repository. The rest of the team complains that the dependency does not get downloaded when they execute yarn .

What could be the reason for this?

A.

The developer added the dependency as a dev dependency, and YARN_ENV is set to production.

B.

The developer missed the option --save when adding the dependency.

C.

The developer added the dependency as a dev dependency, and NODE_ENV is set to production.

D.

The developer missed the option --add when adding the dependency.

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?

A.

{ title: " JavaScript " }

{ title: " JavaScript " }

B.

{ author: " Robert " , title: " JavaScript " }

undefined

C.

{ author: " Robert " }

{ author: " Robert " , title: " JavaScript " }

D.

{ author: " Robert " , title: " JavaScript " }

{ author: " Robert " , title: " JavaScript " }

Given the code:

01 function GameConsole(name) {

02 this.name = name;

03 }

04

05 GameConsole.prototype.load = function(gamename) {

06 console.log( ' ${this.name} is loading a game: ${gamename}.... ' );

07 }

08

09 function Console16bit(name) {

10 GameConsole.call(this, name);

11 }

12

13 Console16bit.prototype = Object.create(GameConsole.prototype);

14

15 // insert code here

16 console.log( ' ${this.name} is loading a cartridge game: ${gamename}.... ' );

17 }

18

19 const console16bit = new Console16bit( ' SNEGeneziz ' );

20 console16bit.load( ' Super Monic 3x Force ' );

What should a developer insert at line 15?

A.

Console16bit = Object.create(GameConsole.prototype).load = function(gamename) {

B.

Console16bit.prototype.load(gamename) = function() {

C.

Console16bit.prototype.load(gamename) {

D.

Console16bit.prototype.load = function(gamename) {

Refer to the code declarations below:

let str1 = ' Java ' ;

let str2 = ' Script ' ;

Which three expressions return the string JavaScript?

A.

`${str1}${str2}`

B.

str1.concat(str2);

C.

const({str1, str2});

D.

str1 + str2;

E.

str1.join(str2);

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 every time a user clicks the button, instead of just the first time.

01 function listen(event) {

02

03 alert( ' Hey! I am John Doe ' );

04

05 }

06 button.addEventListener( ' click ' , listen);

Which two code lines make this code work as required?

A.

On line 04, use event.stopPropagation();

B.

On line 02, use event.first to test if it is the first execution.

C.

On line 06, add an option called once to button.addEventListener().

D.

On line 04, use button.removeEventListener( ' click ' , listen);

Refer to the code below:

01 new Promise((resolve, reject) = > {

02 const fraction = Math.random();

03 if (fraction > 0.5) reject( ' fraction > 0.5, ' + fraction);

04 resolve(fraction);

05 })

06 .then(() = > console.log( ' resolved ' ))

07 .catch((error) = > console.error(error))

08 .finally(() = > console.log( ' when am I called? ' ));

When does Promise.finally on line 08 get called?

A.

When rejected

B.

When resolved and settled

C.

When resolved

D.

When resolved or rejected

Which statement accurately describes an aspect of promises?

A.

Arguments for the callback function passed to .then() are optional.

B.

.then() cannot be added after a catch.

C.

.then() manipulates and returns the original promise.

D.

In a .then() function, returning results is not necessary since callbacks will catch the result of a previous promise.

A developer is trying to convince management that their team will benefit from using Node.js for a backend server that they are going to create. The server will be a web server that handles API requests from a website that the team has already built using HTML, CSS, and JavaScript.

Which three benefits of Node.js can the developer use to persuade their manager?

A.

Executes server-side JavaScript code to avoid learning a new language.

B.

Performs a static analysis on code before execution to look for runtime errors.

C.

Uses non-blocking functionality for performant request handling.

D.

Ensures stability with one major release every few years.

E.

Installs with its own package manager to install and manage third-party libraries.

Refer to the code below:

let inArray = [ [1, 2], [3, 4, 5] ];

Which two statements result in the array [1, 2, 3, 4, 5]?

(With corrected typing errors: usArray → inArray, .. → ....)

A.

[].concat(...inArray);

B.

[].concat.apply(inArray, [] );

C.

[].concat::...inArray();

D.

[].concat.apply({}, inArray);

A developer needs to debug a Node.js web server because a runtime error keeps occurring at one of the endpoints.

The developer wants to test the endpoint on a local machine and make the request against a local server to look at the behavior. In the source code, the server.js file will start the server. The developer wants to debug the Node.js server only using the terminal.

Which command can the developer use to open the CLI debugger in their current terminal window?

(With corrected typing errors: node_inspect → node inspect, node_start_inspect → node start inspect.)

A.

node start inspect server.js

B.

node inspect server.js

C.

node server.js --inspect

D.

node -i server.js