Summer Sale Limited Time 75% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code = simple75

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

Exam JavaScript-Developer-I Premium Access

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

Practice at least 50% of the questions to maximize your chances of passing.
Viewing page 5 out of 5 pages
Viewing questions 41-50 out of questions
Questions # 41:

Refer to the code:

01 const event = new CustomEvent(

02 // Missing code

03 );

04 obj.dispatchEvent(event);

A developer needs to dispatch a custom event called update to send information about recordId.

Which two options can be inserted at line 02?

Options:

A.

{ type: ' update ' , recordId: ' 123abc ' }

B.

' update ' , { detail: { recordId: ' 123abc ' } }

C.

' update ' , ' 123abc '

D.

' update ' , { recordId: ' 123abc ' }

Questions # 42:

A developer wants to catch any error that countSheep() may throw and pass it to handleError().

Which implementation is correct?

Options:

A.

try {

setTimeout(function() {

countSheep();

}, 1000);

}

catch (e) {

handleError(e);

}

B.

try {

countSheep();

} finally {

handleError(e);

}

C.

try {

countSheep();

} handleError(e) {

catch(e);

}

D.

setTimeout(function() {

try {

(Answer incomplete in option list.)

Questions # 43:

A developer creates a class that represents a news story based on the requirements that a Story should have a body, author, and view count. The code is shown below:

01 class Story {

02 // Insert code here

03 this.body = body;

04 this.author = author;

05 this.viewCount = viewCount;

06 }

07 }

Which statement should be inserted in the placeholder on line 02 to allow for a variable to be set to a new instance of a Story with the three attributes correctly populated?

Options:

A.

constructor() {

B.

super(body, author, viewCount) {

C.

function Story(body, author, viewCount) {

D.

constructor(body, author, viewCount) {

Questions # 44:

Corrected code:

let obj = {

foo: 1,

bar: 2

};

let output = [];

for (let something in obj) {

output.push(something);

}

console.log(output);

What is the output of line 11?

Options:

A.

[ " bar " , " foo " ]

B.

[1, 2]

C.

[ " foo " , " bar " ]

D.

[ " foo:1 " , " bar:2 " ]

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