Salesforce JS-Dev-101 Practice Exam Questions & Answers

6 Free Questions · Last reviewed: October 6, 2026 · Prepared & Reviewed by the ValidExamDumps Editorial Team

Exam Facts

Salesforce JS-Dev-101 Exam Details

Key details for this exam, checked against the published exam outline

147 Practice Questions (Our Bank)
120 minutes Exam Duration
Exam Code
JS-Dev-101
Full Name
Salesforce Certified JavaScript Developer
Issuing Body
Salesforce
Question Format (Our Bank)
Multiple Choice
Practice Questions

Free JS-Dev-101 Practice Questions

Each question shows the correct answer and an explanation of why it is right

VA
ValidExamDumps Editorial Team Every question and its answer is checked by our JS-Dev-101 exam preparation team, who also write the explanation shown with each one. How we research and review these pages

Value of:

true + 3 + '100' + null

Correct Answer: A
Explanation

The correct answer is A.

JavaScript evaluates the expression from left to right:

true + 3 + '100' + null

Step 1:

true + 3

In numeric addition, true is converted to:

1

So:

true + 3

becomes:

1 + 3

Result:

4

Step 2:

4 + '100'

Because one operand is a string, JavaScript performs string concatenation instead of numeric addition.

So:

4 + '100'

becomes:

'4100'

Step 3:

'4100' + null

Again, because one operand is already a string, JavaScript converts null into the string:

'null'

So the final result is:

'4100null'

Execution summary:

true + 3 + '100' + null

// 1 + 3 + '100' + null

// 4 + '100' + null

// '4100' + null

// '4100null'

Therefore, the verified answer is A.

A class was written to represent regular items and sale items. Code:

01 let regItem = new Item('Scarf', 55);

02 let saleItem = new SaleItem('Shirt', 80, .1);

03 Item.prototype.description = function() { return 'This is a ' + this.name; }

04 console.log(regItem.description());

05 console.log(saleItem.description());

06

07 SaleItem.prototype.description = function() { return 'This is a discounted ' + this.name; }

08 console.log(regItem.description());

09 console.log(saleItem.description());

What is the output?

Correct Answer: B
Explanation

At line 03, the developer assigns:

Item.prototype.description = function() { return 'This is a ' + this.name; }

This affects all objects whose prototype chain includes Item.prototype.

regItem inherits from Item gets this method.

saleItem, as an instance of SaleItem, also inherits Item.prototype (since SaleItem uses prototype inheritance from Item), so it also has this method at this moment.

Outputs at lines 04 and 05:

regItem.description() 'This is a Scarf'

saleItem.description() 'This is a Shirt'

At line 07, the developer overrides the method on SaleItem.prototype:

SaleItem.prototype.description = function() {

return 'This is a discounted ' + this.name;

}

From this point:

regItem still uses the Item.prototype version

saleItem uses the overridden SaleItem.prototype version

Outputs at lines 08 and 09:

regItem.description() 'This is a Scarf'

saleItem.description() 'This is a discounted Shirt'

Combining all results:

This is a Scarf

This is a Shirt

This is a Scarf

This is a discounted Shirt

This matches option B.

JavaScript Knowledge Reference (text-only)

Objects created from constructor functions use prototype chaining.

Overriding a subclass prototype method does not affect the parent class prototype.

Instances inherit the most specific version of the method on their prototype chain.

Considering type coercion, what does the following expression evaluate to?

true + '13' + NaN

Correct Answer: A
Explanation

Expression:

true + '13' + NaN

The + operator is left-associative, so evaluation order:

true + '13'

When one operand is a string, + performs string concatenation.

true is converted to string 'true'.

'true' + '13' 'true13'.

Result from step 1 with NaN:

'true13' + NaN

Again, one operand is a string, so concatenation.

NaN is converted to string 'NaN'.

'true13' + 'NaN' 'true13NaN'.

Final value: 'true13NaN'.

So A is correct.

Why others are wrong:

B: '113NaN' would require true to coerce to 1 first and no string to be present, which is not the case because '13' forces string concatenation.

C: 14 would require pure numeric addition, which is not the case once a string is involved.

D: 'true13' ignores the final + NaN part.

Concepts: type coercion with +, boolean to string, NaN to string, left-associative evaluation.

A team at Universal Containers works on a big project and uses Yarn to deal with the project's dependencies. A developer added a dependency to manipulate dates and pushed the updates to the remote repository. The rest of the team complains that the dependency does not get downloaded when they execute yarn.

What could be the reason for this?

Correct Answer: B
Explanation

If the dependency was added as a dev dependency (yarn add --dev), it goes into devDependencies.

When NODE_ENV=production, Yarn (and npm) typically skip devDependencies on install.

Thus the package doesn't get installed for other team members in a production environment.

YARN_ENV is not a standard variable, --save is npm syntax (and Yarn saves by default), and --add is not how Yarn works (the command itself is yarn add).

What are two unique features of fat-arrow functions compared to normal function definitions?

Correct Answer: A, B
Explanation

Arrow functions have two defining characteristics:

Implicit return when written as a single expression:

const fn = () => 5; // returns 5 automatically

This is unique to arrow functions A is correct.

Lexical this binding:

Arrow functions do not create their own this.

Instead, they use the this value from the surrounding scope B is correct.

Incorrect options:

C is false: There is no special argument called parentThis.

D is the opposite of arrow function behavior:

Normal functions create their own this; arrow functions do not.

JavaScript Knowledge Reference (text-only)

Arrow functions have lexical this binding.

Arrow functions support implicit return for single expressions.

A Node.js server library uses events and callbacks. The developer wants to log any issues the server has at boot time.

Which code logs an error with an event?

Correct Answer: C
Explanation

Node.js event-based modules use the EventEmitter pattern.

The correct syntax for listening to events is:

emitter.on('eventName', callback)

The server library emits an 'error' event, which must be listened to using .on.

Option analysis:

A: .catch is for Promises, not EventEmitters.

B: .error is not an EventEmitter method.

C: Correct. Listens to the 'error' event.

D: try...catch only captures synchronous errors, not event-based asynchronous errors.

Therefore, the correct answer is option C.

JavaScript Knowledge Reference (text-only)

The EventEmitter API uses on(event, handler) to listen for events.

Errors emitted asynchronously cannot be caught with try...catch.

The 'error' event is standard for Node.js modules to signal operational errors.

Full Access

Get the complete JS-Dev-101 question set

  • 147 questions covering all exam domains
  • Correct answers with explanations, like the free questions above
  • PDF and online practice test
  • 90 days of free updates
Starting from 50% OFF
$20 $40
Get Full Access

One-time payment · Instant download

Study Guide

What the Salesforce JS-Dev-101 Exam Covers

Exam domains verified against: Official Salesforce JS-Dev-101 exam guide, last checked October 2026.

Domain 1: Variables, Types, and Collections 23%

Write code to create and initialize variables correctly, working with strings, numbers, and dates. Demonstrate understanding of type coercion effects, truthy and falsey evaluations, array data manipulation, and JSON object operations.

Sample questions from this domain above: Q3Q4

Domain 2: Objects, Functions, and Classes 25%

Apply object, function, and class implementations to meet business requirements. Understand how to use JavaScript modules and decorators, and analyze variable scope and execution flow within code blocks.

Sample question from this domain above: Q6

Domain 3: Browser and Events 17%

Use events, event handlers, and event propagation to meet business requirements. Evaluate and manipulate the DOM, use browser developer tools to investigate code behavior, and work with browser specific APIs.

Sample question from this domain above: Q5

Domain 4: Debugging and Error Handling 7%

Handle errors properly in code scenarios. Use the browser console and breakpoints to debug code and trace application behavior.

Domain 5: Asynchronous Programming 13%

Apply asynchronous programming concepts including callbacks, promises, and async/await. Understand the event loop and how it controls execution flow and determines outcomes.

Sample question from this domain above: Q1

Domain 6: Server Side JavaScript 8%

Infer which Node.js implementation, CLI command, and library or framework fit a given scenario. Distinguish which Node.js package management solution is most appropriate and know the core Node.js modules.

Sample question from this domain above: Q2

Domain 7: Testing 7%

Analyze unit tests alongside code blocks to identify where tests are ineffective. Modify tests to make them more effective at validating code reliability.

FAQ

JS-Dev-101 Exam FAQ

Common questions about the exam itself

What background do I need before taking the JS-Dev-101 exam?
You should have solid experience writing JavaScript code and building applications on the Salesforce platform. The exam covers browser-based JavaScript and Node.js, so familiarity with both client-side and server-side JavaScript is important. Most candidates find the exam challenging if they have not written production code in JavaScript.
How long does it typically take to prepare for JS-Dev-101?
Most candidates spend between 4 and 8 weeks preparing, depending on their existing JavaScript experience. If you are already working with JavaScript daily in Salesforce projects, you might prepare more quickly. If JavaScript is newer to you, allocate more time to practice asynchronous programming and scope concepts.
Which objective area is the hardest part of JS-Dev-101?
Many candidates struggle most with Asynchronous Programming, especially closures, promises, and the event loop. Objects, Functions, and Classes is also challenging because it requires understanding scope and execution flow at a deep level. Practice with real code examples rather than just reading about these topics.
What is the exam format for JS-Dev-101?
The exam contains 60 multiple-choice or multiple-select questions, with up to five additional non-scored questions. You must answer the questions within the time limit and pass with a minimum score determined by Salesforce psychometric analysis.
Can I retake JS-Dev-101 if I fail?
Yes, you can retake the exam. Salesforce allows you to schedule another attempt after your first attempt, though there may be a waiting period between attempts depending on your local policies. Check your exam registration portal for specific retake and rescheduling rules.
How long is the JS-Dev-101 certification valid for?
Salesforce certifications are valid for three years from the date you pass. After that, you must either retake the exam or renew your certification through a renewal path if one is available for your specific certification.
What job role does the JS-Dev-101 certification prepare me for?
This certification is designed for developers who build and maintain JavaScript applications within the Salesforce ecosystem. It qualifies you for roles such as Salesforce JavaScript Developer, Lightning Component Developer, or full-stack Salesforce Developer.
How does JS-Dev-101 relate to other Salesforce developer certifications?
JS-Dev-101 is one of several Salesforce Developer certifications. It focuses on JavaScript and modern web development patterns on the platform. Many developers combine it with Apex-focused certifications like Certified Platform Developer to broaden their skills across multiple Salesforce development languages.
Does JS-Dev-101 cover Lightning components?
The exam covers JavaScript fundamentals and how they apply across the platform, including asynchronous patterns used in Lightning. However, it focuses primarily on core JavaScript concepts rather than Lightning-specific APIs, so you should understand JavaScript first.
What study resources does Salesforce provide for JS-Dev-101?
Salesforce provides study modules through Trailhead Academy, a curated trailmix with interactive content, hands-on projects, and guided learning paths. These resources are designed to help you get exam ready using Salesforce's own materials.