Summer Sale Special 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: ex2p65

Exact2Pass Menu

Salesforce Certified JavaScript Developer (JS-Dev-101)

Last Update 19 hours ago Total Questions : 219

The Salesforce Certified JavaScript Developer (JS-Dev-101) content is now fully updated, with all current exam questions added 19 hours ago. Deciding to include JavaScript-Developer-I practice exam questions in your study plan goes far beyond basic test preparation.

You'll find that our JavaScript-Developer-I exam questions frequently feature detailed scenarios and practical problem-solving exercises that directly mirror industry challenges. Engaging with these JavaScript-Developer-I sample sets allows you to effectively manage your time and pace yourself, giving you the ability to finish any Salesforce Certified JavaScript Developer (JS-Dev-101) practice test comfortably within the allotted time.

Question # 4

Refer to the code below?

Let searchString = ‘ look for this ’;

Which two options remove the whitespace from the beginning of searchString?

Choose 2 answers

A.

searchString.trimEnd();

B.

searchString.trimStart();

C.

trimStart(searchString);

D.

searchString.replace(/*\s\s*/, ‘’);

Question # 5

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

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 Scarf

Uncaught TypeError: saleItem.description is not a function

This is aScarf

This is a discounted Shirt

B.

This is a Scarf

This is a Shirt

This is a Scarf

This is a discounted Shirt

C.

This is a Scarf

This is a Shirt

This is a discounted Scarf

This is a discounted Shirt

D.

This is aScarf

Uncaught TypeError: saleItem.description is not a function

This is a Shirt

This is a did counted Shirt

Question # 6

Cloud Kicks has a class to represent items for sale in an online store, as shown below:

Class Item{

constructor (name, price){

this.name = name;

this.price = price;

}

formattedPrice(){

return ‘s’ + String(this.price);}}

A new business requirement comes in that requests a ClothingItem class that should have all of

the properties and methods of the Item class but will also have properties that are specific to

clothes.

Which line of code properly declares the clothingItem class such that it inherits from

Item?

A.

Class ClothingItem implements Item{

B.

Class ClothingItem {

C.

Class ClothingItem super Item {

D.

Class ClothingItem extends Item {

Question # 7

GIven a value, which three options can a developer use to detect if the value is NaN?

Choose 3 answers !

A.

value == NaN

B.

Object.is(value, NaN)

C.

value === Number.NaN

D.

value ! == value

E.

Number.isNaN(value)

Question # 8

Refer to the code below:

const addBy = ?

const addByEight =addBy(8);

const sum = addBYEight(50);

Which two functions can replace line 01 and return 58 to sum?

Choose 2 answers

A.

const addBy = function(num1){

return function(num2){

return num1 + num2;

}

B.

const addBy = function(num1){

return num1 + num2;

}

C.

const addBy = (num1) => num1 + num2 ;

D.

const addBY = (num1) => (num2) => num1 + num2;

Question # 9

Refer to following code block:

Let array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,];

Let output =0;

For (let num of array){

if (output >0){

Break;

}

if(num % 2 == 0){

Continue;

}

Output +=num;

What is the value of output after the code executes?

A.

16

B.

36

C.

11

D.

25

Question # 10

At Universal Containers, every team has its own way of copying JavaScript objects. The

code

Snippet shows an implementation from one team:

Function Person() {

this.firstName = “John”;

this.lastName = ‘Doe’;

This.name =() => (

console.log(‘Hello $(this.firstName) $(this.firstName)’);

)}

Const john = new Person ();

Const dan = JSON.parse(JSON.stringify(john));

dan.firstName =’Dan’;

dan.name();

What is the Output of the code execution?

A.

Hello Dan Doe

B.

Hello John DOe

C.

TypeError: dan.name is not a function

D.

TypeError: Assignment to constant variable.

Go to page: