Salesforce Certified JavaScript Developer I Practice Exam
Prepare for the multiple-choice exam of Salesforce’s platform-agnostic JavaScript credential — core language mastery from variables and collections through objects, functions, classes, async programming, the browser, and testing. Scenario questions, instant feedback in Learn mode, a full timed simulation in Exam mode, and source-linked explanations from MDN.
Start 24-hour free trial →JavaScript Developer I exam at a glance
- Vendor
- Salesforce
- Credential
- Salesforce Certified JavaScript Developer I
- Structure
- Two parts: this MC exam (JS-Dev-101) + Lightning Web Components Specialist superbadge
- Exam code
- None — named credential (identifier JS-Dev-101)
- Questions
- 60 multiple-choice/multiple-select (plus up to 5 unscored)
- Duration
- 105 minutes
- Passing score
- 65%
- Cost
- $200 USD registration; $100 USD retake
- Focus
- Platform-agnostic core JavaScript (not Salesforce configuration)
Source: Salesforce Trailhead — JavaScript Developer I credential and the official exam guide. Confirm current details before scheduling.
About the JavaScript Developer I certification
The Salesforce Certified JavaScript Developer I credential is platform-agnostic — it tests core JavaScript language proficiency rather than Salesforce-specific configuration. It’s a two-part credential: the JavaScript Developer I multiple-choice exam (covered by this practice set) and the Lightning Web Components Specialist superbadge, a hands-on project. You earn both in any order, and together they award the certification. This page prepares you for the multiple-choice exam.
The exam is scenario-driven and code-focused: you read a snippet or a described situation and pick the correct behavior or best practice — why a var leaks out of a block, how async/await desugars to Promises, when to reach for Promise.all(), why an arrow function preserves this, how Shadow DOM scopes styles. Async patterns and closures are tested heavily, and several questions present subtle bugs to diagnose. Because the skills are pure JavaScript, they transfer to any framework — not just Lightning Web Components. PowerKram maps every question to one of the seven exam domains and links each explanation to MDN (or Jest), the authoritative JavaScript references. For how this credential fits the Salesforce developer track, see our Salesforce definitive guide.
Exam domains and weights
Salesforce publishes seven weighted domains for the multiple-choice exam. Objects, Functions & Classes and Variables, Types & Collections together account for nearly half the exam, so weight your study there. The weights below sum to 100 — confirm the current blueprint on Salesforce’s exam guide.
Prototypes and the prototype chain, ES6 classes, modules (named/default exports and imports), closures, this binding, and JavaScript design patterns.
Declaration and scope (var/let/const, hoisting), types and coercion, truthy/falsy evaluation, strings, numbers, dates, JSON, and array manipulation.
DOM manipulation, the event loop and event handling, web components and Shadow DOM, and browser APIs.
Callbacks, Promises and Promise combinators, async/await, and how asynchronous code interacts with the event loop.
Node.js fundamentals, the module system (CommonJS vs ES modules), and the npm ecosystem.
Error types and try/catch/finally, throwing and handling errors, and browser DevTools debugging techniques.
Unit testing with Jest, mocking dependencies (including fetch), assertions, and test structure.
Source: Salesforce Certified JavaScript Developer I exam guide (seven domains; weights sum to 100). Confirm the current blueprint on Salesforce’s guide before scheduling.
Who this exam is for
It’s a language-proficiency credential for developers working across the modern web stack:
- Salesforce developers building Lightning Web Components who want to validate core JavaScript skills.
- Front-end developers entering the Salesforce ecosystem via LWC.
- Full-stack JavaScript developers working across browser and Node.js.
- Developers with 1–2 years of JavaScript experience seeking a recognized, framework-agnostic credential.
There are no prerequisites. Because the skills are pure JavaScript, this credential complements the Salesforce-specific developer track: the Platform Developer I and Platform Developer II credentials cover Apex and the platform, while the B2C Commerce Developer credential leans heavily on JavaScript in a commerce context. For the roles this credential supports, see the Salesforce developer career guide.
What this practice exam delivers
Score by domain
Every question is tagged to one of the seven exam domains — from Objects/Functions/Classes to Testing — so your report shows exactly which JavaScript area to sharpen.
Learn mode
Immediate feedback after each question with a full explanation of why the right answer is right and the others wrong — built for code-analysis questions and subtle-bug diagnosis.
Exam mode
A timed run that mirrors the 60-question, 105-minute format and the 65% bar, so pacing feels familiar on test day.
MDN-sourced explanations
Every answer links to MDN (or Jest) — the authoritative JavaScript references — so you learn the language from the source, not just a memorized letter.
Sample JavaScript Developer I practice questions
Ten free code-focused questions across the seven domains, each with a full explanation and a source link to MDN or Jest. The complete bank is available with the 24-hour trial.
A developer declares a variable inside an if block using var and is surprised to find it accessible outside the block.
What explains this behavior?
- Variables declared with
varare function-scoped or globally-scoped, not block-scoped, so they are hoisted to the enclosing function - The
ifblock creates a new function scope that leaks variables - The JavaScript engine optimizes variable access by promoting block variables
- This is a browser bug that does not occur in Node.js
Show answer & explanation
Correct: A. var declares function-scoped (or global) variables that are hoisted to the top of the enclosing function — unlike block-scoped let/const. This is fundamental JavaScript behavior in every environment, not a bug.
Why not the others: an if block doesn’t create function scope (B); there’s no “promotion” optimization (C); and it happens in Node.js too, so it isn’t a browser bug (D).
A developer writes a function that fetches user data from an API and needs to handle both successful responses and network errors gracefully.
What is the modern best practice for handling this asynchronous operation?
- Use nested callbacks with an error-first pattern
- Use synchronous
XMLHttpRequestto simplify error handling - Use
async/awaitwith atry/catchblock to handle both the resolved value and any errors from the fetch - Use
setTimeoutto poll for the API response
Show answer & explanation
Correct: C. async/await with try/catch reads like synchronous code while catching both network and API errors — the modern standard that replaces callback nesting and raw Promise chains for most cases.
Why not the others: nested callbacks (A) create callback hell; synchronous XHR (B) blocks the main thread; and polling with setTimeout (D) is inefficient and unreliable.
A developer needs to create a utility module that exports multiple helper functions for use across a JavaScript application.
What is the correct ES6 module syntax?
- Attach the functions to the global
windowobject - Use named exports (
export function/const) in the module and named imports ({ functionName }) in consuming files - Define all functions as global variables in a script tag
- Use CommonJS
require()andmodule.exportsexclusively
Show answer & explanation
Correct: B. ES6 named exports expose specific functions and named imports consume them, giving clear dependency management and tree-shaking support.
Why not the others: window globals (A) and script-tag globals (C) pollute the namespace and lack encapsulation; and CommonJS (D) is Node’s system — ES modules are the language standard.
A developer has an array of order objects and needs to calculate total revenue from only the completed orders.
What method chain should the developer use?
- Use
array.filter()to select completed orders, thenarray.reduce()to sum the revenue values - Use a
forloop with a running total and anifcondition - Use
array.find()to locate each completed order individually - Use
array.map()to transform all orders, then sum the results
Show answer & explanation
Correct: A. Chaining filter() (select completed orders) and reduce() (accumulate revenue) is the concise, expressive functional approach.
Why not the others: a for loop (B) works but is more verbose; find() (C) returns only the first match, not all; and map() (D) transforms but doesn’t filter.
A developer creates objects with a constructor function and wants all instances to share a method without duplicating it in memory.
Where should the developer define this shared method?
- Inside the constructor as
this.method = function(){} - As a global function that accepts the object as a parameter
- In a separate module that each instance imports independently
- On the constructor function’s
prototypeobject, so all instances inherit it through the prototype chain
Show answer & explanation
Correct: D. Methods on the constructor’s prototype are shared across all instances through the prototype chain, with a single memory allocation.
Why not the others: defining it in the constructor (A) creates a new function per instance, wasting memory; a global function (B) loses encapsulation; and separate imports (C) don’t provide prototype-based sharing.
Source: MDN — Inheritance & the prototype chain →A callback inside a class method loses access to the instance’s properties when passed to setTimeout.
What is causing this, and how should the developer fix it?
- Class properties are private and cannot be accessed in callbacks
setTimeoutdoes not support callback functions from classes- The
thiscontext is lost becausesetTimeoutinvokes the callback in the global context; use an arrow function, which lexically bindsthis - The callback executes before the class is fully initialized
Show answer & explanation
Correct: C. A regular function passed to setTimeout has this bound to the global object (or undefined in strict mode). An arrow function lexically binds this from the enclosing scope, preserving the instance; bind() is an alternative.
Why not the others: class properties are accessible (A); setTimeout supports any callable (B); and timing isn’t the issue (D).
A developer needs a web component that encapsulates its styling so external CSS can’t affect the component’s internal elements.
Which web standard should the developer use?
- Shadow DOM to create an encapsulated DOM tree with scoped styling that prevents CSS leaking in or out
- CSS modules with unique class-name prefixes
- An
iframethat isolates the component completely - Inline styles on every element within the component
Show answer & explanation
Correct: A. Shadow DOM creates an encapsulated subtree with its own scoped styles — external CSS can’t penetrate the boundary and internal styles don’t leak out. It’s the web standard for style encapsulation in web components.
Why not the others: inline styles (D) are unmaintainable; CSS modules (B) need a build step and are a convention, not a browser standard; and an iframe (C) is heavyweight over-isolation.
A developer needs to run three asynchronous operations in parallel and wait for all of them to complete before proceeding.
Which Promise method should the developer use?
- Use
Promise.race()to get the fastest result - Use
Promise.all()with an array of the three Promise-returning operations - Chain three
.then()calls sequentially - Use
Promise.any()to get the first successful result
Show answer & explanation
Correct: B. Promise.all() takes an array of promises and resolves when all resolve (or rejects if any rejects) — enabling parallel execution with one await point.
Why not the others: sequential .then() chains (C) lose parallelism; Promise.race() (A) resolves on the first to settle; and Promise.any() (D) resolves on the first success, ignoring the rest.
A developer needs to write unit tests for a function that makes fetch API calls to an external service.
What testing approach should the developer use?
- Make real API calls in the test and validate the response
- Skip testing this function since it depends on an external service
- Mock the
fetchfunction using Jest’s mocking capabilities to return controlled responses, then test behavior across mock scenarios - Test only in production to get real API responses
Show answer & explanation
Correct: C. Mocking fetch isolates the unit under test, making tests fast, deterministic, and independent of API availability; different mock responses exercise success, error, and edge cases.
Why not the others: real API calls (A) make tests slow and flaky; skipping (B) leaves code uncovered; and production testing (D) risks real side effects.
Source: Jest — Mock Functions → Further reading: PowerKram — DevOps guide →A developer is implementing a debounce to limit how often a search API is called as a user types.
What JavaScript concept is essential for implementing debounce?
- Synchronous function calls that block the event loop
- Web Workers to process search queries in a separate thread
- Event delegation on the parent container of the input field
- Closures to maintain timer state across invocations, combined with
clearTimeout/setTimeoutto delay execution until typing pauses
Show answer & explanation
Correct: D. Debounce uses a closure to hold a timer reference across calls; each keystroke clears the previous timer and sets a new one, so the search runs only when the user pauses long enough.
Why not the others: synchronous calls (A) block the UI; Web Workers (B) are for CPU-bound work, not timing; and event delegation (C) routes events but doesn’t rate-limit.
Source: MDN — Closures →Keep going: study guides and career paths
JavaScript Developer I is a language-proficiency credential in the Salesforce developer track. Two PowerKram hubs back this exam.
Deep dive: the two parts, the seven domains, and a study plan
Two parts: exam + superbadge
The most important structural fact: the full certification requires two things — passing this multiple-choice exam and completing the Lightning Web Components Specialist superbadge. You can do them in any order, and each is a credential in its own right; earning both automatically awards the Salesforce Certified JavaScript Developer I certification. This practice set targets the multiple-choice exam; plan separately for the hands-on superbadge in a Developer Edition org. Compare with Platform Developer I →
Format and logistics
The multiple-choice exam is 60 questions (multiple-choice and multiple-select, plus up to five unscored) in 105 minutes, with a 65% pass mark, registered at $200 ($100 retake), proctored onsite or online. There are no prerequisites, and Salesforce recommends 1–2 years of JavaScript experience. Salesforce certifications generally require periodic release-maintenance modules to stay active — confirm the current maintenance status for this credential on the exam guide. Advance with Platform Developer II →
It’s platform-agnostic
This is Salesforce’s framework-agnostic developer credential: it tests pure JavaScript — scope and closures, prototypes and this, Promises and the event loop, the DOM and Shadow DOM, Node modules, and testing — not Salesforce configuration. The payoff is that everything you learn transfers to any framework, while also being exactly the language foundation Lightning Web Components are built on. Weight your prep toward Objects/Functions/Classes (25%) and Variables/Types/Collections (23%), which together are nearly half the exam.
Realistic study plan
Complete the “Study for the Salesforce JavaScript Developer I Exam” trail on Trailhead (three cert-prep modules), then deepen weak areas with MDN — especially closures, this binding, prototypes, and async. Build a small Lightning Web Component that uses async data fetching, custom events, and Jest tests to make the concepts concrete (and to progress the superbadge). Most candidates prepare over eight to twelve weeks depending on JavaScript experience. Use PowerKram Learn mode for code-analysis questions, then finish in Exam mode across all seven domains under the 105-minute clock. Developer career paths →
Frequently asked questions about the JavaScript Developer I exam
Is the certification just this exam?
What is the exam format and passing score?
What domains does the exam cover?
Is this a Salesforce-specific exam?
Are there prerequisites?
Start your free 24-hour JavaScript Developer I practice trial
Full access to 1,600+ questions across all seven domains, both study modes, and MDN-sourced explanations. No credit card required.
Start free trial →