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

Pass the Salesforce Developer JavaScript-Developer-I Questions and answers with ValidTests

Exam JavaScript-Developer-I All Questions
Exam JavaScript-Developer-I Premium Access

View all detail and faqs for the JavaScript-Developer-I exam

Viewing page 5 out of 5 pages
Viewing questions 41-50 out of questions
Questions # 41:

Considering the implications of 'use strict' on line 04, which three statements describe the execution of the code?

Choose 3 answers

Options:

A.

z is equal to 3.14.

B.

'use strict' is hoisted, so it hasan effect on all lines.

C.

'use strict' has an effect only on line 05.

D.

'use strict' has an effect between line 04 and the end of the file.

E.

Line 05 throws an error.

Expert Solution
Questions # 42:

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?

Options:

A.

Class ClothingItem implements Item{

B.

Class ClothingItem {

C.

Class ClothingItem super Item {

D.

Class ClothingItem extends Item {

Expert Solution
Questions # 43:

A developer 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

Expert Solution
Questions # 44:

After user acceptance testing, thedeveloper is asked to change the webpage background based on user's location. This change was implemented and deployed for testing.

The tester reports that the background is not changing, however it works as required when viewing on the developer's computer.

Which two actions will help determine accurate results?

Choose 2 answers

Options:

A.

The developer should inspect their browser refresh settings.

B.

The tester should disable their browser cache.

C.

The developer should rework the code.

D.

The tester shoulddear their browser cache.

Expert Solution
Questions # 45:

Refer to the following code:

01 function Tiger(){

02this.Type = ‘Cat’;

03 this.size = ‘large’;

04 }

05

06 let tony = new Tiger();

07 tony.roar = () =>{

08 console.log(‘They\’regreat1’);

09 };

10

11 function Lion(){

12 this.type = ‘Cat’;

13 this.size = ‘large’;

14 }

15

16 let leo = new Lion();

17 //Insertcode here

18 leo.roar();

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

Choose 2 answers.

Options:

A.

Leo.roar = () => { console.log(‘They\’re pretty good:’); };

B.

Object.assign(leo,Tiger);

C.

Object.assign(leo,tony);

D.

Leo.prototype.roar = () => { console.log(‘They\’re pretty good:’); };

Expert Solution
Questions # 46:

Given the JavaScript below:

Question # 46

Which code should replace the placeholder comment on line 06 to hide accounts that do not match the search string?

Options:

A.

‘None’ : ‘block’

B.

‘Visible : ’hidden’

C.

‘Hidden, visible

D.

‘Block’ : ‘none’

Expert Solution
Questions # 47:

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 Aand 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

Expert Solution
Questions # 48:

Refer to the HTML below:

Question # 48

Which JavaScript statement results in changing “ The Lion.”?

Options:

A.

document.querySelectorAll(‘$main $TONY’).innerHTML = ’“ The Lion

B.

document.querySelector(‘$main li:second-child’).innerHTML = “The Lion ’;

C.

document.querySelector(‘$main li.Tony’).innerHTML = ’“ The Lion ’;

D.

document.querySelector(‘$main li:nth-child(2)’),innerHTML = “ The Lion. ’;

Expert Solution
Questions # 49:

A developer wants to create an object from afunction in the browser using the code

below:

Function Monster() { this.name = ‘hello’ };

Const z = Monster();

What happens due to lackof the new keyword on line 02?

Options:

A.

The z variable is assigned the correct object.

B.

The z variable is assigned the correct object but this.name remains undefined.

C.

Window.name is assigned to ‘hello’ and the variable z remains undefined.

D.

Window.m is assigned the correct object.

Expert Solution
Questions # 50:

Refer to the following code:

function test (val) {

If (val === undefined) {

return ‘Undefined values!’ ;

}

if (val === null) {

return ‘Null value!’;

}

return val;

}

Let x;

test(x);

What is returned by the function call on line 13?

Options:

A.

Undefined

B.

Line 13 throws an error.

C.

‘Undefined values!’

D.

‘Null value!’

Expert Solution
Viewing page 5 out of 5 pages
Viewing questions 41-50 out of questions