Salesforce javascript developer i practice test

Certified JavaScript Developer I

Last exam update: Apr 08 ,2024
Page 1 out of 12. Viewing questions 1-15 out of 180

Question 1

A developer is trying to handle an error within a function.
Which code segment shows the correct approach to handle an error without propagating it
elsewhere?
A)

B)

C)

D)

  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D
Answer:

D

User Votes:
A
50%
B
50%
C
50%
D
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 2

Which two options are core Node.js modules?
Choose 2 answers

  • A. worker
  • B. isotream
  • C. exception
  • D. http
Answer:

B, D

User Votes:
A
50%
B
50%
C
50%
D
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 3

Refer to the code below:

What is the value of result after line 10 executes?

  • A. Error: myFather.job is not a function
  • B. John Developer
  • C. undefined Developer
  • D. John undefined
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 4

Refer to the code below:

Which value can a developer expect when referencing country,capital,cityString?

  • A. 'London'
  • B. undefined
  • C. An error
  • D. 'NaN'
Answer:

D

User Votes:
A
50%
B
50%
C
50%
D
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 5

Given the code below:

Which method can be used to provide a visual representation of the list of users and to allow sorting
by the name or email attribute?

  • A. console.group(usersList) ;
  • B. console.table(usersList) ;
  • C. console.info(usersList) ;
  • D. console.groupCol lapsed (usersList) ;
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 6

Refer to the code below:

Considering that JavaScript is single-threaded, what is the output of line 08 after the code executes?

  • A. 10
  • B. 11
  • C. 12
  • D. 13
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 7

Refer to the following code block:

What is the console output?

  • A. > Better student Jackie got 70% on test.
  • B. > Jackie got 70% on test.
  • C. > Uncaught Reference Error
  • D. > Better student Jackie got 100% on test.
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 8

Which statement can a developer apply to increment the browser's navigation history without a
page refresh?
Which statement can a developer apply to increment the browser's navigation history without a
page refresh?

  • A. window.history.pushState(newStateObject);
  • B. window.history.pushStare(newStateObject, ' ', null);
  • C. window.history.replaceState(newStateObject,' ', null);
  • D. window.history.state.push(newStateObject);
Answer:

C

User Votes:
A
50%
B
50%
C
50%
D
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 9

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

  • A. z is equal to 3.14.
  • B. 'use strict' is hoisted, so it has an 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.
Answer:

A, C, E

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%

Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 10

Refer to the following code:

What is the output of line 11?

  • A. [1,2]
  • B. ["bar", "foo"]
  • C. ["foo:1", "bar:2"]
  • D. ["foo", "bar"]
Answer:

D

User Votes:
A
50%
B
50%
C
50%
D
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 11

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) [ ]);
  • B. myArray. join (","). split (",");
  • C. [ ] .concat {. . .myArray) ;
  • D. myArray.flat(Infinity);
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 12

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"
  • B. "newUserName"
  • C. "User-name available"
  • D. undefined
Answer:

C

User Votes:
A
50%
B
50%
C
50%
D
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 13

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) ;
  • B. str, substr(0,5) ;
  • C. str, substring(1,5) ;
  • D. str, substr(1,5) ;
Answer:

A, B

User Votes:
A
50%
B
50%
C
50%
D
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 14

developer uses the code below to format a date.

After executing, what is the value of formattedDate?

  • A. May 10, 2020
  • B. June 10, 2020
  • C. October 05, 2020
  • D. November 05, 2020
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 15

Refer to the code below:

What is the value of result when the code executes?

  • A. 10-10
  • B. 5-5
  • C. 10-5
  • D. 5-10
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000
To page 2