ExamGecko
Home Home / Salesforce / Certified JavaScript Developer I

Salesforce Certified JavaScript Developer I Practice Test - Questions Answers, Page 16

Question list
Search
Search

List of questions

Search

Related questions











Given the following code:

is the output of line 02?

A.
''x''
A.
''x''
Answers
B.
''null'''
B.
''null'''
Answers
C.
''object''
C.
''object''
Answers
D.
''undefined''
D.
''undefined''
Answers
Suggested answer: C

A test has a dependency on database. query. During the test, the dependency is replaced with an object called database with the method, Calculator query, that returns an array. The developer does not need to verify how many times the method has been called.

Which two test approaches describe the requirement?

Choose 2 answers

A.
White box
A.
White box
Answers
B.
Stubbing
B.
Stubbing
Answers
C.
Black box
C.
Black box
Answers
D.
Substitution
D.
Substitution
Answers
Suggested answer: A, D

Universal Containers (UC) just launched a new landing page, but users complain that the website is slow. A developer found some functions any that might cause this problem. To verify this, the developer decides to execute everything and log the time each of these three suspicious functions consumes.

Which function can the developer use to obtain the time spent by every one of the three functions?

A.
console. timeLog ()
A.
console. timeLog ()
Answers
B.
console.timeStamp ()
B.
console.timeStamp ()
Answers
C.
console.trace()
C.
console.trace()
Answers
D.
console.getTime ()
D.
console.getTime ()
Answers
Suggested answer: A

A developer wrote the following code to test a sum3 function that takes in an array of numbers and returns the sum of the first three numbers in the array, and the test passes.

A different developer made changes to the behavior of sum3 to instead sum only the first two numbers present in the array.

Which two results occur when running this test on the updated sum3 function?

Choose 2 answers

A.
The line 05 assertion passes.
A.
The line 05 assertion passes.
Answers
B.
The line 02 assertion passes.
B.
The line 02 assertion passes.
Answers
C.
The line 02 assertion fails.
C.
The line 02 assertion fails.
Answers
D.
The line 05 assertion fails.
D.
The line 05 assertion fails.
Answers
Suggested answer: B, D

A developer has a web server running with Node.js. The command to start the web server is node server.js. The web server started having latency issues. Instead of a one second turnaround for web requests, the developer now sees a five second turnaround.

Which command can the web developer run to see what the module is doing during the latency period?

A.
NODE_DEBUG=true node server.js
A.
NODE_DEBUG=true node server.js
Answers
B.
DEBUG=http, https node server.js
B.
DEBUG=http, https node server.js
Answers
C.
NODE_DEBUG=http,https node server.js
C.
NODE_DEBUG=http,https node server.js
Answers
D.
DEBUG=true node server.js
D.
DEBUG=true node server.js
Answers
Suggested answer: D

Refer to the code below:

What is the value of result when the code executes?

A.
10-10
A.
10-10
Answers
B.
5-5
B.
5-5
Answers
C.
10-5
C.
10-5
Answers
D.
5-10
D.
5-10
Answers
Suggested answer: A

developer uses the code below to format a date.

After executing, what is the value of formattedDate?

A.
May 10, 2020
A.
May 10, 2020
Answers
B.
June 10, 2020
B.
June 10, 2020
Answers
C.
October 05, 2020
C.
October 05, 2020
Answers
D.
November 05, 2020
D.
November 05, 2020
Answers
Suggested answer: B

Refer of the string below:

Const str = 'sa;esforce'=;

Which two statement result in the word 'Sale'?

Choose 2 answers

A.
str, substring (0,5) ;
A.
str, substring (0,5) ;
Answers
B.
str, substr(0,5) ;
B.
str, substr(0,5) ;
Answers
C.
str, substring(1,5) ;
C.
str, substring(1,5) ;
Answers
D.
str, substr(1,5) ;
D.
str, substr(1,5) ;
Answers
Suggested answer: A, B

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.

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

A.
"msg is not defined"
A.
"msg is not defined"
Answers
B.
"newUserName"
B.
"newUserName"
Answers
C.
"User-name available"
C.
"User-name available"
Answers
D.
undefined
D.
undefined
Answers
Suggested answer: C

myArraym can have one level, two levels, or more levels.

Which statement flattens myArray when it can be arbitrarily nested?

A.
myArray. reduce ((prev, curr) => prev.concat(curr) [ ]);
A.
myArray. reduce ((prev, curr) => prev.concat(curr) [ ]);
Answers
B.
myArray. join (","). split (",");
B.
myArray. join (","). split (",");
Answers
C.
[ ] .concat {. . .myArray) ;
C.
[ ] .concat {. . .myArray) ;
Answers
D.
myArray.flat(Infinity);
D.
myArray.flat(Infinity);
Answers
Suggested answer: A
Total 224 questions
Go to page: of 23