JavaScript-Developer-I Salesforce Certified JavaScript Developer (JS-Dev-101) Free Practice Exam Questions (2025 Updated)
Prepare effectively for your Salesforce JavaScript-Developer-I Salesforce Certified JavaScript Developer (JS-Dev-101) certification with our extensive collection of free, high-quality practice questions. Each question is designed to mirror the actual exam format and objectives, complete with comprehensive answers and detailed explanations. Our materials are regularly updated for 2025, ensuring you have the most current resources to build confidence and succeed on your first attempt.
Given two expressions var1 and var2. What are two valid ways to return the logical AND
of the two expressions and ensure it is data type Boolean ?
Choose 2 answers:
Refer to the code below:

Considering that JavaScript is single-threaded, what is the output of line 08 after the code executes?
Whichthree actions can be using the JavaScript browser console?
Choose 3 answers:
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 notneed to verify how many times the method has been called.
Which two test approaches describe the requirement?
Choose 2 answers
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
A developer wrote a fizzbuzz function thatwhen passed in a number, returns the
following:
● ‘Fizz’ if the number is divisible by 3.
● ‘Buzz’ if the number is divisible by 5.
● ‘Fizzbuzz’ if the number is divisible by both 3 and 5.
● Empty string if the number is divisible by neither 3 or 5.
Whichtwo test cases will properly test scenarios for the fizzbuzz function?
Choose 2 answers
Refer to the following code:
Let sampleText = ‘The quick brown fox jumps’;
A developer needs to determine if a certainsubstring is part of a string.
Which three expressions return true for the given substring ?
Choose 3 answers
Refer to thefollowing code that imports a module named utils:
import (foo, bar) from ‘/path/Utils.js’;
foo() ;
bar() ;
Which two implementations of Utils.js export foo and bar such that the code above runs without
error?
Choose 2 answers
Given the code below:
const copy = JSON.stringify([ newString(‘ false ’), new Bollean( false ), undefined ]);
What is the value of copy?
Given code below:
setTimeout (()=> (
console.log(1);
). 0);
console.log(2);
New Promise ((resolve, reject )) = > (
setTimeout(() => (
reject(console.log(3));
). 1000);
)).catch(() => (
console.log(4);
));
console.log(5);
What is logged to the console?
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
Refer to the code below:

Line 05 causes an error.
What are the values of greeting and salutation once code completes?
A developer has the following array of hourly wages:
Let arr = (8, 5, 9, 75, 11, 25, 7, 75, , 13, 25);
For workers making less than $10 an hour rate should be multiple by 1.25 and returned in a new array.
How should the developer implement the request?
A developer at Universal Containers is creating their new landing pagebased on HTML, CSS, and JavaScript. The website includes multiple external resources that are loaded when the page is opened.
To ensure that visitors have a good experience, a script named personalizeWebsiteContent needs to be executed when the webpage isloaded and there is no need to wait for the resources to be available.
Which statement should be used to call personalizeWebsiteContent based on the above business requirement?
A developer has a formatName function that takes two arguments, firstName and lastName and returns a string. They want to schedule the
function to run once after five seconds.
What is the correct syntax toschedule this function?
Which function should a developer use to repeatedly execute code at a fixed interval ?
Referto the code below:
new Promise((resolve, reject) => {
const fraction = Math.random();
if( fraction >0.5) reject("fraction > 0.5, " + fraction);
resolve(fraction);
})
.then(() =>console.log("resolved"))
.catch((error) => console.error(error))
.finally(() =>console.log(" when am I called?"));

When does Promise.finally on line 08 get called?
A developer is setting up a new Node.js server with a client library that is built using events and callbacks.
The library:
● Will establish a web socket connection and handle receipt of messages to theserver
● Will be imported with require, and made available with a variable called we.
The developer also wants to add error logging if a connection fails.
Given this info, which code segment shows the correct way to set up a client with two events that listen at execution time?
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 developer creates 1000 monster objects.
How many growl methods are created with Option A Option B?
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?