Salesforce JavaScript Developer I Practice Exams
Last updated on Nov 16,2026- Exam Code: JavaScript Developer I
- Exam Name: Salesforce Certified JavaScript Developer I
- Certification Provider: Salesforce
- Latest update: Nov 16,2026
Refer to the following code that performs a basic mathematical operation on a provided input:
function calculate(num) {
Return (num +10) / 3;
}
How should line 02 be written to ensure that x evaluates to 6 in the line below? Let x = calculate (8);
- A . Return Number((num +10) /3 );
- B . Return (Number (num +10 ) / 3;
- C . Return Integer(num +10) /3;
- D . Return Number(num + 10) / 3;
Given HTML below:
<div>
<div id =”row-uc”> UniversalContainer</div>
<div id =”row-aa”>Applied Shipping</div>
<div id =”row-bt”> Burlington Textiles </div>
</div>
Which statement adds the priority = account CSS class to the universal Containers row?
- A . Document .querySelector(‘#row-uc’).classes.push(‘priority-account’);
- B . Document .queryElementById(‘row-uc’).addclass(‘priority-account’);
- C . Document .querySelector(‘#row-uc’).classList.add(‘priority-account’);
- D . Document .querySelectorALL(‘#row-uc’).classList.add(‘priority-account’);
A developer needs to debug a Node.js web server because a runtime error keeps occurring at one of the endpoints.
The developer wants to test the endpoint on a local machine and make the request against a local server to look at the behavior. In the source code, the server, js file will start the server. the developer wants to debug the Node.js server only using the terminal.
Which command can the developer use to open the CLI debugger in their current terminal window?
- A . node -i server.js
- B . node inspect server,js
- C . node server,js inspect
- D . node start inspect server,js
A developer is working on an ecommerce website where the delivery date is dynamically calculated based on the current day. The code line below is responsible for this calculation. Const deliveryDate = new Date ();
Due to changes in the business requirements, the delivery date must now be today’s date + 9 days.
Which code meets this new requirement?
- A . deliveryDate.setDate(( new Date ()).getDate () +9);
- B . deliveryDate.setDate( Date.current () + 9);
- C . deliveryDate.date = new Date(+9) ;
- D . deliveryDate.date = Date.current () + 9;
Refer tofollowing code:
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 line 09 for the code to display ‘The truck 123AB has a weight of 5000lb.’?
- A . Super.plate =plate;
- B . super(plate);
- C . This.plate =plate;
- D . Vehicle.plate = plate;
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.
- B . The line 02 assertion passes.
- C . The line 02 assertion fails.
- D . The line 05 assertion fails.
Given the following code:
![]()
What is the output of line 02?
- A . "null"
- B . "x-
- C . "undefined" 0
- D . ‘object"
A developer is setting up a Node,js server and is creating a script at the root of the source code, index,js, that will start the server when executed. The developer declares a variable that needs the folder location that the code executes from.
Which global variable can be used in the script?
- A . window.location
- B . _filename
- C . _dirname
- D . this.path
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.
Cloud Kicks has a class to represent items for sale in an online store, as shown below:
Class Item{
constructor (name, price){
this.name = name;
this.price = price;
}
formattedPrice(){
return ‘s’ + String(this.price);}}
A new business requirement comes in that requests a ClothingItem class that should have all of the properties and methods of the Item class but will also have properties that are specific to clothes.
Which line of code properly declares the clothingItem class such that it inherits from Item?
- A . Class ClothingItem implements Item{
- B . Class ClothingItem {
- C . Class ClothingItem super Item {
- D . Class ClothingItem extends Item {