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: 2

Questions 11

Refer to code below:

console.log(0);

setTimeout(() => (

console.log(1);

});

console.log(2);

setTimeout(() => {

console.log(3);

), 0);

console.log(4);

In which sequence will the numbers be logged?

Options:
A.

01234

B.

02431

C.

02413

D.

13024

Questions 12

Refer to the followingcode:

JavaScript-Developer-I Question 12

Options:
Questions 13

Refer to the following array:

Let arr = [1, 2, 3, 4, 5];

Which three options result in x evaluating as [1,2]?

Choose 3 answer

Options:
A.

let x = arr.slice (2);

B.

let x = arr. slice (0, 2);

C.

let x arr.filter((a) => (return a <= 2 });

D.

let x = arr.filter ((a) => 2 }) ;

E.

let x =arr.splice(0, 2);

Questions 14

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

JavaScript-Developer-I Question 14

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

Options:
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 ( ) {

Questions 15

Refer to the code below?

Let searchString = ‘ look for this ’;

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

Choose 2 answers

Options:
A.

searchString.trimEnd();

B.

searchString.trimStart();

C.

trimStart(searchString);

D.

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

Questions 16

Which two options arecore Node.js modules?

Choose 2 answers

Options:
A.

worker

B.

isotream

C.

exception

D.

http

Questions 17

A developer writes the code below to return a message to a user attempting to register a new username. If the username is available, a variable named nag is declared and assigned a value on line 03.

JavaScript-Developer-I Question 17

What is the value of msg when getAvailableabilityMessage (“newUserName”) is executed and get Availability (“newUserName”) returns true?

Options:
A.

"msg is not defined"

B.

"newUserName"

C.

"User-name available"

D.

undefined

Questions 18

Given the following code:

Let x =(‘15’ + 10)*2;

What is the value of a?

Options:
A.

3020

B.

1520

C.

50

D.

35

Questions 19

Refer to the HTML below:

JavaScript-Developer-I Question 19

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. ’;

Questions 20

A test has a dependency on database.query. During the test the dependency is replaced

with an object called database with the method, query, that returns an array. The

developer needs to verify how many times the method was called and the arguments

used each time.

Which two test approaches describe the requirement?

Choose 2 answers

Options:
A.

Integration

B.

Black box

C.

White box

D.

Mocking