Salesforce JAVASCRIPT DEVELOPER I Exam Questions

Questions for the JAVASCRIPT DEVELOPER I were updated on : Nov 30 ,2025

Page 1 out of 15. Viewing questions 1-15 out of 219

Question 1

A developer initiates a server with the file server,js and adds dependencies in the source codes
package,json that are required to run the server.
Which command should the developer run to start the server locally?

  • A. start server,js
  • B. npm start server,js
  • C. npm start
  • D. node start
Answer:

C

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

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

Question 2

After user acceptance testing, the developer 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

  • 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 should dear their browser cache.
Answer:

A,D

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

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

Question 3

A developer wants to use a module called DataPrettyPrint. This module exports one default
functioncalled printDate ().
How can a developer import and use the printDate() function?
A)

B)

C)

D)

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

B

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

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

Question 4

A developer has the function, shown below, that is called when a page loads.

Where can the developer see the log statement after loading the page in the browser?

  • A. On the browser JavaScriptconsole
  • B. On the terminal console running the web server
  • C. In the browser performance tools log
  • D. On the webpage console log
Answer:

A

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

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

Question 5

A developer at Universal Containers is creating their new landing page based on HTML, CSS, and
JavaScript.
To ensure that visitors have a good experience, a script named personalizeWebsiteContent needs to
be executed when the webpage is fully loaded (HTML content and all related files), in order to do
some custom initializations.
Which implementation should be used to call Fe:s:-a;::eHec5;te::.-.ter.: based on the business
requirement above?

  • A. Add a listener to thewindow object to handle the DOMContentLoaded event
  • B. Add a handler to the personalizeWebsiteContent script to handle the load event
  • C. Add a listener to the window object to handle the lead event
  • D. Add a handler to the personalizeWebsiteContent script tohandle the DOMContentLoaded event
Answer:

C

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

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

Question 6

Given the following code:

What is the output of line 02?

  • A. "null"
  • B. "x-
  • C. "undefined" 0
  • D. 'object"
Answer:

D

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

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

Question 7

A developer tries to retrieve all cookies, then sets a certain key value pair in the cookie. These
statements are used:

What is the behavior?

  • A. Cookies are read, but the key value is not set because the value is not URL encoded.
  • B. Cookies are not read because line 01 should be document, cookies, but the key value is set and all cookies are wiped.
  • C. A Cookies are read andthe key value is set, the remaining cookies are unaffected.
  • D. Cookies are read and the key value is set, and all cookies are wiped.
Answer:

C

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

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

Question 8

Given the JavaScript below:

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

  • A. ‘None’ : ‘block’
  • B. ‘Visible : ’hidden’
  • C. ‘Hidden, visible
  • D. ‘Block’ : ‘none’
Answer:

D

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

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

Question 9

Refer to the code below:

What is the result when the Promise in the execute function is rejected?

  • A. Resolved1 Resolved2 Resolved3Resolved4
  • B. Rejected
  • C. Rejected Resolved
  • D. Rejected1 Rejected2 Rejected3 Rejected Rejected Rejected4
Answer:

C

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

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

Question 10

Refer to the code below:
const car = {
price:100,
getPrice:function(){
return this.price;
}
};
const customCar = Object.create(car);
customCar.price = 70;
delete customCar.price;const result = customCar.getPrice();
Whatis the value of result after the code executes?

  • A. 100
  • B. undefined
  • C. null
  • D. 70
Answer:

A

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

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

Question 11

Refer to the followingcode:
class Vehicle{
constructor(plate){
this.plate = plate;
}
}
class Truck extends Vehicle{
constructor(plate, weight){
//Missing code
this.weight = weight;
}
displayWeight(){
console.log(`The truck ${this.plate} has a weight of ${this.weight}lb.`);
}
}let myTruck = new Truck('123Ab',5000);
myTruck.displayWeight();
Which statement should be added to missing code for the code to display 'The truck 123AB has a
weight of 5000lb.

  • A. super(plate)
  • B. super.plate = plate
  • C. Vehicle.plate = plate
  • D. this.plate= plate
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 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 A and Option B?

  • 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
Answer:

B

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

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

Question 13

Refer to the code below
let inArray = [[1,2],[3,4,5]];
which two statements results in the array [1,2,3,4,5]?
choose 2 answer

  • A. [ ].concat(...inArray);
  • B. [ ].concat.apply(inArray,[ ]);
  • C. [ ].concat([...inArray])
  • D. [ ].concat.apply([ ],inArray);
Answer:

A,D

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

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

Question 14

At Universal Containers, every team has its own way of copyingJavaScript objects. The code snippet
shows an Implementation from one team:

What is the output of the code execution?

  • A. Hello John Doe
  • B. Hello Dan
  • C. Hello Dan Doe
  • D. SyntaxError: Unexpected token in JSON
Answer:

D

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

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

Question 15

A developer writes the code below to calculate the factorial of a given number
function sum(number){
return number * sum(number-1);
}
sum(3);
what is the result of executing the code.

  • A. 0
  • B. 6
  • C. Error
  • D. -Infinity
Answer:

C

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

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