Summer Special 60% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: bestdeal

Free Salesforce JavaScript-Developer-I Practice Exam with Questions & Answers | Set: 3

Questions 21

Refer to code below:

function Person() {

this.firstName = ’John’;

}

Person.prototype ={

Job: x => ‘Developer’

};

const myFather = new Person();

const result=myFather.firstName+ ‘ ‘ + myFather.job();

What is the value of the result after line 10 executes?

Options:
A.

Error: myFather.job is not a function

B.

Undefined Developer

C.

John undefined

D.

John Developer

Questions 22

Refer to the following code:

JavaScript-Developer-I Question 22

What is the value ofoutput on line 11?

Options:
A.

[1, 2]

B.

[‘’foo’’, ‘’bar’’]

C.

[‘’foo’’:1, ‘’bar’’:2’’]

D.

An error will occur due to the incorrect usage of the for…of statement on line 07.

Questions 23

Adeveloper has an ErrorHandler module that contains multiple functions.

What kind of export be leverages so that multiple functions can beused?

Options:
A.

Named

B.

All

C.

Multi

D.

Default

Questions 24

Given the following code:

JavaScript-Developer-I Question 24

What is the output of line 02?

Options:
A.

"null"

B.

"x-

C.

"undefined" 0

D.

'object"

Questions 25

Refer to the code below:

const car = {

price:100,

getPrice:function(){

return this.price;

}

};

const customCar = Object.create(car);

customCar.price = 70;

delete customCar.price;const result = customCar.getPrice();

Whatis the value of result after the code executes?

Options:
A.

100

B.

undefined

C.

null

D.

70

Questions 26

Referto the following code:

JavaScript-Developer-I Question 26

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

Choose 2 answers

Options:
A.

Object.assign (leo, tony);

B.

Object.assign (leo. Tiger);

C.

leo.roar = () => { console.log('They\'re pretty good!'); );

D.

leo.prototype.roar = ( ) =>( console.log('They\'re pretty good!'); };

Questions 27

Given HTML below:

UniversalContainer

Applied Shipping

Burlington Textiles

Which statement adds the priority = account CSS class to the universal Containers row ?

Options:
A.

Document .querySelector(‘#row-uc’).classes.push(‘priority-account’);

B.

Document .queryElementById(‘row-uc’).addclass(‘priority-account’);

C.

Document .querySelector(‘#row-uc’).classList.add(‘priority-account’);

D.

Document .querySelectorALL(‘#row-uc’).classList.add(‘priority-account’);

Questions 28

A developer has two ways to write a function:

Option A:

function Monster(){

this.growl = ()=>{

console.log('Grr!');

}

}

Option B:

function Monster(){};

Monster.prototype.growl = ()=>{

console.log('Grr!');

}

After deciding on an option, the developercreates 1000 monster objects.

How many growl methods are created with Option A and Option B?

Options:
A.

1000 for Option A, 1 for Option B

B.

1 methods for both

C.

1000 for both

D.

1 for Option A, 1000 for Option B

Questions 29

A developer at Universal Containers is creating their new landing pagebased on HTML, CSS, and JavaScript. The website includes multiple external resources that are loaded when the page is opened.

To ensure that visitors have a good experience, a script named personalizeWebsiteContent needs to be executed when the webpage isloaded and there is no need to wait for the resources to be available.

Which statementshould be used to call personalizeWebsiteContent based on the above business requirement?

Options:
A.

windows,addEventListener('load', personalizeWebsiteContent);

B.

windows,addEventListener('DOMContent Loaded ', personalizeWebsiteContent);

C.

windows,addEventListener('onload', personalizeWebsiteContent);

D.

windows,addEventListener('onDOMCContentLoaded', personalizeWebsiteContent);

Questions 30

Refer of the string below:

Const str = ‘sa;esforce’=;

Which two statement result in the word 'Sale'?

Choose 2 answers

Options:
A.

str, substring(0,5) ;

B.

str, substr(0,5) ;

C.

str, substring(1,5) ;

D.

str, substr(1,5) ;