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

The developer has a function that prints “Hello” to an input name. To test this,thedeveloper created a function that returns “World”. However the following snippet does not print “ Hello World”.

What can the developer do to change the code to print “Hello World” ?

A.

Change line 7 to ) () ;

B.

Change line 2 to console.log(‘Hello’ ,name() );

C.

Change line 9 to sayHello(world) ();

D.

Change line 5 to function world ( ) {

Given two expressions var1 and var2. What are two valid ways to return the logical AND

of the two expressions and ensure it is data type Boolean ?

Choose 2 answers:

A.

Boolean(var1 && var2)

B.

var1 && var2

C.

var1.toBoolean() && var2toBoolean()

D.

Boolean(var1) && Boolean(var2)

A class was written to represent items for purchase in an online store, and a secondclass

Representing items that are on sale at a discounted price. THe constructor sets the name to the

first value passed in. The pseudocode is below:

Class Item {

constructor(name, price) {

… // Constructor Implementation

}

}

Class SaleItem extends Item {

constructor (name, price, discount) {

...//Constructor Implementation

}

}

There is a new requirement for a developer to implement a description method that will return a

brief description for Item and SaleItem.

Let regItem =new Item(‘Scarf’, 55);

Let saleItem = new SaleItem(‘Shirt’ 80, -1);

Item.prototype.description = function () { return ‘This is a ’ + this.name;

console.log(regItem.description());

console.log(saleItem.description());

SaleItem.prototype.description = function () { return ‘This is a discounted ’ +

this.name; }

console.log(regItem.description());

console.log(saleItem.description());

What is the output when executing the code above ?

A.

This is a ScarfUncaught TypeError: saleItem.description is not a functionThis is aScarfThis is a discounted Shirt

B.

This is a ScarfThis is a ShirtThis is a ScarfThis is a discounted Shirt

C.

This is a ScarfThis is a ShirtThis is a discounted ScarfThis is a discounted Shirt

D.

This is aScarfUncaught TypeError: saleItem.description is not a functionThis is a ShirtThis is a did counted Shirt

Referto the code below:

new Promise((resolve, reject) => {

const fraction = Math.random();

if( fraction >0.5) reject("fraction > 0.5, " + fraction);

resolve(fraction);

})

.then(() =>console.log("resolved"))

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

.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

A developer at Universal Containers is creating their 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 when the webpage is fully loaded (HTML content and all related files), in order to do some custom initializations.

Which implementation should be used to call Fe:s:-a;::eHec5;te::.-.ter.: based on the business requirement above?

A.

Add a listener to thewindow object to handle the DOMContentLoaded event

B.

Add a handler to the personalizeWebsiteContent script to handle the load event

C.

Add a listener to the window object to handle the lead event

D.

Add a handler to the personalizeWebsiteContent script tohandle the DOMContentLoaded event

myArraym can have one level, two levels, or more levels.

Which statement flattens myArray when it can be arbitrarily nested?

A.

myArray. reduce ((prev, curr) => prev.concat(curr) [ ]);

B.

myArray. join (",").split (",");

C.

[ ] .concat {. . .myArray) ;

D.

myArray.flat(Infinity);

Refer to the string below.

Const str=’Salesforce’;

Which two statementsresults in the word 'Sales'?

A developer is working on an ecommerce website where the delivery date is dynamically

calculated based on the current day. The code line below is responsible for this calculation.

Const deliveryDate = new Date ();

Due to changes in the business requirements, the delivery date must now be today’s

date + 9 days.

Which code meets thisnew requirement?

A.

deliveryDate.setDate(( new Date ( )).getDate () +9);

B.

deliveryDate.setDate( Date.current () + 9);

C.

deliveryDate.date = new Date(+9) ;

D.

deliveryDate.date = Date.current () + 9;

Refer to code below:

Let a =’a’;

Let b;

// b = a;

console.log(b);

What is displayed when the code executes?

A.

ReferenceError: b is not defined

B.

A

C.

Undefined

D.

Null

developer publishes a new version of a package with new features that do not break

backward compatibility. The previous version number was 1.1.3.

Following semantic versioning format, what should the new package version number

be?

A.

2.0.0

B.

1.2.3

C.

1.1.4

D.

1.2.0