Limited-Time Offer: Enjoy 50% Savings! - Ends In 1d 3h 41m 32s Coupon code: 50OFF

Salesforce JS-Dev-101 Exam Questions & Answers (November 2026)

Salesforce Certified JavaScript Developer exam questions with 20 free practice questions and explained answers. Updated November 25, 2026. ยท See all Salesforce exams

Answer 20 scenario questions on this page and see your score as you go. No sign-up needed.

Exam Details

Exam Code
JS-Dev-101
Vendor
Salesforce
Question Types
Single Choice
Official Page
View Exam Page
1

Variables, Types, and Collections

23% of the exam

This topic covers how to declare and initialize variables, work with common JavaScript types, and manipulate arrays and JSON data. Candidates must be able to predict how values behave in expressions, including type conversion and truthy or falsey evaluation.

Question 1 of 20 Single Choice

A Lightning Web Component receives a quantity as the string "4.75" from a text input. The unit price is stored in a numeric variable as 2.5. The component must calculate a numeric line total for later arithmetic, and the quantity is guaranteed to contain a valid decimal number. Which expression calculates the numeric total correctly?

Which expression calculates the numeric total correctly?

Show Answer

Correct Answer

A

Option A is correct because converting the valid decimal string to a number before multiplication produces the numeric total of 11.875. Option B is not correct because the plus operator joins the string and number. Option C is not correct because parseInt removes the fractional part. Option D is not correct because it divides instead of calculating the line total.

Question 2 of 20 Single Choice

A Salesforce reporting component receives an opportunities array from an API response. It must display only opportunities whose StageName is Closed Won and whose Amount is greater than 50000. Other parts of the component still use the original array, so the selection must produce a separate array and must not reorder or alter the source records. Which expression meets these requirements?

Which expression creates the required array without changing opportunities?

Show Answer

Correct Answer

A

Option A is correct because filter returns a new array containing only Closed Won opportunities with an Amount above 50000, leaving the original list unchanged. Option B is not correct because map returns Boolean values for every opportunity. Option C is not correct because sort changes the original array and does not apply the required criteria. Option D is not correct because find returns only the first matching opportunity.

Question 3 of 20 Single Choice

A Salesforce case-reporting component receives JSON records from a service. Each record has `openedOn` and `closedOn` as ISO date-only strings such as `2025-03-08`, and the dates are guaranteed valid with the close date on or after the open date. Agents in several time zones need whole calendar days between dates, including intervals crossing daylight-saving changes. The calculation must not depend on browser local time, and the parsed records must remain unchanged.

Which expression calculates the whole number of calendar days between the two date-only values?

Show Answer

Correct Answer

C

Option C is correct because subtracting the parsed ISO date-only values gives a UTC millisecond interval, which can be divided by 86,400,000 to produce calendar days without local-time or daylight-saving effects. Option A and Option B are not correct because division occurs before subtraction. Option D is not correct because day-of-month values fail across month boundaries.

2

Objects, Functions, and Classes

25% of the exam

This topic covers how JavaScript functions, objects, classes, modules, and scope behave in application code. Candidates must choose implementations that meet requirements and trace how names and methods are resolved during execution.

Question 4 of 20 Single Choice

A logistics team uses a JavaScript class named `Shipment` whose constructor stores a per-unit rate on each instance. Its `calculateFee(weight)` method multiplies the supplied weight by that rate. The team is adding an `ExpressShipment` subclass with an instance property named `expressSurcharge`. Express quotes must include the ordinary shipment fee and this surcharge, and the method must use the weight passed into each call.

Which implementation of `ExpressShipment.calculateFee` meets the requirement?

Show Answer

Correct Answer

A

Option A is correct because `super.calculateFee(weight)` runs the inherited calculation with the supplied weight and the instance's rate, then adds the express surcharge. Option B is not correct because `calculateFee` is an instance method, not a static method on `Shipment`. Option C is not correct because the direct prototype call uses the prototype as `this`, which has no rate. Option D is not correct because it omits the rate-based fee.

Question 5 of 20 Single Choice

A billing team deploys the same JavaScript module for several regions. Each region has a fixed tax rate, and the application must create a calculator for each rate. The returned calculator should accept only a subtotal, retain its region's rate without relying on global state, and calculate each total independently. Which function implementation meets these requirements?

A billing team deploys the same JavaScript module for several regions. Each region has a fixed tax rate, and the application must create a calculator for each rate. The returned calculator should accept only a subtotal, retain its region's rate without relying on global state, and calculate each total independently. Which function implementation meets these requirements?

Show Answer

Correct Answer

A

Option A is correct because the returned function closes over its own rate parameter, so separate calculators retain their regional rates and need only a subtotal. Option B writes to shared global state, so creating another calculator can change earlier calculations. Option C uses a shadowing call-time rate. Option D depends on a receiver property that the returned function is not given.

Question 6 of 20 Single Choice

A Salesforce service evaluates records against a policy object. The method `isEligible(record)` reads `this.minimumScore`, and the policy object is also used by other checks. The service must pass a callback to `records.some`, preserve the policy object as the method receiver, and avoid creating a wrapper callback. Which expression meets these requirements?

A Salesforce service evaluates records against a policy object. The method `isEligible(record)` reads `this.minimumScore`, and the policy object is also used by other checks. The service must pass a callback to `records.some`, preserve the policy object as the method receiver, and avoid creating a wrapper callback. Which expression meets these requirements?

Show Answer

Correct Answer

A

Option A is correct because `bind(policy)` returns a callback that uses the policy object as `this` when `some` invokes it. Option B passes the method without its receiver, so `this.minimumScore` will not refer to the policy. Option C calls the method immediately rather than supplying a callback. Option D works with a wrapper, which the requirement excludes.

3

Browser and Events

17% of the exam

This topic covers browser events, event handlers, propagation, DOM interaction, and browser APIs. Candidates must select suitable event behavior and browser features to meet application requirements.

Question 7 of 20 Single Choice

A customer portal displays a list of service cards. Each card has one click handler that opens the service details, while a nested button performs a separate action. The button contains an SVG icon, and testing shows that clicking the icon also opens the details. The team wants to retain one delegated handler per card and keep the separate button action unchanged. Which change should the developer make to the card click handler?

Which change should the developer make to the card click handler?

Show Answer

Correct Answer

A

Option A is correct because `closest` recognizes clicks on the nested SVG as part of an action button. Option B is not correct because the event target can be the SVG, not the button. Option C is not correct because preventing a default action does not stop the click from bubbling. Option D is not correct because it removes navigation for clicks on the rest of each card.

Question 8 of 20 Single Choice

A support team is adding a search panel to an existing page. The panel uses a standard HTML form with a text field and a submit button. Search results must be rendered in a results section on the same page, and pressing Enter in the field must work as well as clicking the button. The browser currently navigates to a new URL when the form is submitted. Which implementation best meets the requirements?

Which implementation best meets the search form requirements?

Show Answer

Correct Answer

B

Option B is correct because handling submit covers both Enter and button activation, and preventing its default stops the GET navigation. Option A misses submissions made by pressing Enter. Option C is not correct because stopping propagation does not cancel the browser's default form submission. Option D is not correct because input events do not represent submission.

Question 9 of 20 Single Choice

An analytics page displays a chart inside a resizable content panel. Users can drag a divider to change the panel width, and the browser viewport does not change during this interaction. The chart must be redrawn whenever the panel's content dimensions change. The current window resize listener misses divider adjustments, and the team wants to avoid polling the DOM. Which browser API should the developer use to detect the size changes?

Which browser API should the developer use to detect the size changes?

Show Answer

Correct Answer

C

Option C is correct because ResizeObserver reports changes to the observed panel's dimensions, including changes caused by the split pane. Option A is not correct because the viewport can remain unchanged while the panel resizes. Option B detects DOM mutations, not computed size changes. Option D reports visibility intersection changes, not the panel's dimensions.

4

Debugging and Error Handling

7% of the exam

This topic covers tracing JavaScript defects with the browser console and debugger, and responding to errors without hiding useful information. Candidates must be able to inspect execution state, locate exceptions, and preserve valid application behavior when an operation fails.

Question 10 of 20 Single Choice

A Salesforce service console page calculates a displayed discount from a value passed through several handler calls. The result is wrong only for one customer record, and the final console output confirms the incorrect result but does not show which call supplied the unexpected value. The developer can reproduce the issue in Chrome DevTools and can pause execution without changing the page code.

Which debugging action is most likely to reveal where the incorrect value first enters the calculation?

Show Answer

Correct Answer

B

Option B is correct because pausing before the assignment lets the developer inspect the current local value and the callers that supplied it. Option A is not correct because a later log shows the result but may not reveal when it became incorrect. Option C hides the defect instead of locating it. Option D suppresses evidence rather than identifying the faulty input.

Question 11 of 20 Single Choice

An internal Salesforce service console loads a user-editable JSON preference string before rendering a panel. A malformed string currently causes the click handler to stop with an uncaught SyntaxError, and the panel must keep its last valid preferences while showing a useful message beside the editor. The application must not replace current preferences until the new text has parsed successfully.

Which implementation best meets the error-handling requirement?

Show Answer

Correct Answer

B

Option B is correct because it leaves the last valid preferences unchanged when parsing fails and gives the user a visible error message. Option A is not correct because replacing the settings with defaults discards valid preferences. Option C is not correct because nonempty text can still be invalid JSON and throw. Option D is not correct because finally runs even after parsing fails.

Question 12 of 20 Single Choice

A developer is investigating a reproducible problem in a local Salesforce Lightning page using Chrome DevTools. A handler catches an exception and writes only a generic message to the Console, so the normal uncaught-exception pause does not stop at the failing statement. The developer cannot modify the source before reproducing the problem and needs to identify the exact throw location and its call path.

Which DevTools action will best identify the original throw location without changing the page code?

Show Answer

Correct Answer

D

Option D is correct because pausing on caught exceptions stops at the original throw even though the handler catches it, exposing the source line and call stack. Option A removes useful console evidence but does not locate the throw. Option B pauses after the exception reaches the catch block. Option C adds output after handling and does not reveal where the exception originated.

5

Asynchronous Programming

13% of the exam

This topic covers how JavaScript schedules synchronous work, promise reactions, and timer callbacks, and how asynchronous functions coordinate operations. Candidates must predict execution order and select promise or async and await patterns that respect dependencies and completion requirements.

Question 13 of 20 Single Choice

A client-side status panel records labels from several callbacks while a refresh starts. The code logs start synchronously, schedules a zero-delay timer that logs timer, registers a fulfilled Promise reaction that logs promise and then queues a microtask that logs queued, queues another microtask that logs direct, and finally logs end synchronously. The browser uses standard JavaScript task and microtask processing.

Which sequence of labels does the panel record?

Show Answer

Correct Answer

A

Option A is correct because the synchronous logs run first, then the promise reaction runs before the already queued direct microtask. The queued microtask runs next, and the timer runs after the microtask queue is drained. Option B is not correct because it runs the timer before the microtasks. Option C reverses the two initially queued microtasks. Option D runs the timer too early.

Question 14 of 20 Single Choice

A Salesforce service page must load an account profile and its permission summary before showing a combined panel. The two Promise-returning requests are independent, both results are required, and the panel must render only once after both requests succeed. The current implementation starts the profile request, waits for it, and only then starts the permission request, causing avoidable delay during peak usage.

Which approach best meets the page requirements?

Show Answer

Correct Answer

A

Option A is correct because both independent requests start before Promise.all waits, so the panel can use both required results and render after both succeed. Option B is not correct because it delays the permission request until the profile request finishes. Option C is not correct because Promise.race can resolve when only one result is ready. Option D is not correct because it can render without checking for a rejected request.

Question 15 of 20 Single Choice

A document processing service accepts a file upload and returns a server-generated document ID only after the upload completes. A separate indexing request requires that ID, and a notification must be sent only after indexing succeeds. The UI team wants one async function for this workflow, and the indexing service does not accept a file name or a client-generated substitute.

Which implementation correctly preserves the required dependency and completion order?

Show Answer

Correct Answer

A

Option A is correct because the server-generated identifier exists only after upload resolves, and awaiting indexing ensures notification follows its completion. Option B is not correct because indexing starts before the server has produced the identifier. Option C is not correct because it does not wait for indexing to finish before notifying. Option D is not correct because the file name is not the required identifier and indexing is attempted too early.

6

Server Side JavaScript

8% of the exam

This topic covers Node.js commands, core modules, and package management choices. Candidates must select implementations and tools that fit server-side requirements, including reliable dependency installation and platform-independent file handling.

Question 16 of 20 Single Choice

A team deploys a Node.js service through a pipeline. Before deployment, the gate must detect syntax errors in `server.js`. The check must not start the service, open a network connection, or depend on the service configuration being available. The repository uses npm for other tasks, but this gate only needs to inspect that one file.

Which command should the deployment gate use?

Show Answer

Correct Answer

A

Option A is correct because `node --check` parses `server.js` for syntax errors without running the service or contacting its dependencies, matching the deployment gate. Option B is not correct because it starts the application. Option C is not correct because it runs configured tests. Option D is not correct because it evaluates code that loads the application.

Question 17 of 20 Single Choice

A Node.js worker writes reports beneath a configured output directory. The worker will run on both Windows and Linux, and report names include nested folders supplied by the application. The team wants to avoid manually inserting slash characters or writing separate path logic for each operating system. It needs a built-in module for constructing the target filesystem paths.

Which built-in Node.js module is the best fit?

Show Answer

Correct Answer

A

Option A is correct because the `path` module constructs and normalizes filesystem paths using platform-appropriate separators, which fits the worker's need to locate each report. Option B provides filesystem operations, not path construction. Option C exposes operating system details. Option D handles URL parsing and formatting, not filesystem paths.

Question 18 of 20 Single Choice

A team has committed both `package.json` and `package-lock.json` for its Node.js application. Each continuous integration run starts from a workspace that may contain a leftover `node_modules` directory. The build must install the versions recorded in the lock file, must not silently revise that file, and should fail if the dependency declarations and lock file are inconsistent.

Which command best meets the continuous integration requirement?

Show Answer

Correct Answer

B

Option B is correct because `npm ci` installs dependencies from the committed lock file, removes an existing `node_modules` directory, and fails when the lock file conflicts with `package.json`. Option A can update the lock file. Option C changes dependency versions. Option D updates lock-file data without installing the dependencies needed for the build.

7

Testing

7% of the exam

This topic covers how to judge whether unit tests verify the required behavior and detect likely regressions. Candidates must improve assertions and keep tests isolated so that results depend on the code under test, not leftover test state.

Question 19 of 20 Single Choice

A checkout module applies a discount with the rule that purchases of 100 or more receive a discount of 10. Its Jest suite currently checks a purchase of 120 and expects 10. The product requirement is unchanged, but a code revision accidentally changes the threshold comparison from greater-than-or-equal to greater-than. The existing test still passes, so the team wants one additional test that reveals this defect.

Which additional test best detects the regression described in the scenario?

Show Answer

Correct Answer

A

Option A is correct because testing the exact threshold of 100 detects a change from greater-than-or-equal to greater-than. Option B is not correct because 99 should receive no discount under either comparison. Option C is not correct because 101 receives the same discount under both comparisons. Option D is not correct because it contradicts the stated discount rule.

Question 20 of 20 Single Choice

A notification module calls an injected `send` function once and returns its result. Two Jest tests share `const send = jest.fn(() => 'accepted')`, call the module, and each assert that `send` was called exactly once. The first test passes, but the second fails because the shared mock retains its first test's call history. Both tests also depend on the mock returning `accepted`.

Which change best ensures that each test checks the number of calls made during that test alone?

Show Answer

Correct Answer

A

Option A is correct because `mockClear()` removes prior call history while preserving the mock implementation. Option B is not correct because resetting mocks also removes configured implementations. Option C is not correct because it cannot detect multiple calls. Option D is not correct because it stops checking the dependency used by the module.

Continue Your JS-Dev-101 Preparation

You have seen 20 questions from a full set of 147. Prepare with the JS-Dev-101 dumps PDF and the Web-Based Practice Test.

PDF

  • Compatible with All Devices
  • Printable Format
  • No Download Limits

Practice Test

  • Check your timing and weak areas
  • No Practice Limits
  • Regularly Updated
Get Full Access
  • 100% Money-Back Guarantee
  • 90 Days Free Updates
  • Instant Access

Frequently Asked Questions

Why do variables, types, and collections cause difficulty on JS-Dev-101?

This topic asks you to reason about what JavaScript actually evaluates, not just recall syntax. Type conversion, truthy and falsey values, array operations, and JSON data can produce results that differ from an initial guess. The Exam4Success PDF can help you review these rules away from a coding environment. Practise tracing expressions by hand, then check each result against the relevant JavaScript behavior.

How can I prepare for browser and event questions when I cannot reproduce every scenario?

Event questions can combine DOM interaction, handler selection, and propagation, so memorising browser API names alone may leave gaps. The Exam4Success Practice Test can help you identify which event concepts need more review. For each missed item, sketch the event path and explain where a handler runs and what behavior the requirement calls for. This turns a scenario into a sequence you can reason through.

What practical JavaScript skills does this certification cover for Salesforce developers?

The exam covers core JavaScript work that can support application development, including functions, objects, classes, modules, browser events, asynchronous operations, and testing. It also includes Node.js commands, core modules, and package management, so the scope extends beyond browser-only code. The topics describe skills rather than guaranteeing a particular job outcome. Use the domain list to identify which areas matter most to the Salesforce development work you want to strengthen.

What should I study first if I am beginning preparation for JS-Dev-101?

Start with Variables, Types, and Collections and Objects, Functions, and Classes. Together, these account for the largest stated portions of the exam topics, and they provide concepts used in later areas. Check that you can trace scope and method resolution as well as predict expression results. Then move to asynchronous programming and browser events, using practice questions to reveal where your reasoning needs more work.

What makes asynchronous programming a challenging part of the exam?

You need to distinguish synchronous work from promise reactions and timer callbacks, then decide how async functions should respect dependencies and completion requirements. A small change in ordering can alter whether a result is available when later code runs. The Exam4Success PDF offers a way to review these patterns away from a coding setup. Draw a timeline for each example and label when every callback or promise reaction runs.

Why might knowing JavaScript theory still leave me unprepared for testing and debugging questions?

These topics require decisions about evidence, not just definitions. A test can appear useful while relying on leftover state or making assertions that do not verify the required behavior. Debugging also involves inspecting execution state and locating exceptions without hiding useful information. Review one test at a time, check that its setup is isolated, and confirm that its assertions would detect a likely regression.

Does JS-Dev-101 address both browser development and server-side JavaScript?

Yes. Its stated topics include browser APIs, DOM interaction, and events, as well as Node.js commands, core modules, and package management. That breadth can help candidates assess their knowledge across both client-side and server-side JavaScript practices. The exam topics do not establish a particular career path, so treat them as a skills map. Make a short checklist of browser and Node.js tasks you can explain or implement.

How can I judge whether I am ready to sit the Salesforce Certified JavaScript Developer exam?

Readiness is easier to assess when you can explain your reasoning across all seven topic areas, including the smaller sections on debugging, server-side JavaScript, and testing. Use the Exam4Success Practice Test to review timing and identify weak areas, then revisit those concepts in the guide. Do not rely only on a strong result in one domain. Record recurring errors and review them before making your decision.

Exam4Success is an independent exam preparation provider and is not affiliated with or endorsed by Salesforce.