What is the passing score for the Salesforce JavaScript Developer 1 exam?
The Salesforce Certified JavaScript Developer I exam requires a score of 65% to pass. The exam contains 60 multiple-choice questions with a 105-minute time limit. It tests core JavaScript language fundamentals, asynchronous programming, debugging, testing, and how JavaScript applies within the Lightning Web Components framework on the Salesforce platform. Candidates need strong JavaScript knowledge independent of Salesforce before this exam will be approachable.
The Salesforce Certified JavaScript Developer I (JSD I) certification is unique in the Salesforce credentialing ecosystem because it tests core JavaScript language knowledge rather than Salesforce platform configuration. While the Platform Developer I exam tests Apex and LWC in a Salesforce context, the JavaScript Developer I exam verifies that candidates understand JavaScript as a language -- its syntax, execution model, asynchronous patterns, scope rules, and modern features from ES6 and beyond.
This certification is relevant for Salesforce Lightning Web Component developers who need to demonstrate JavaScript language proficiency alongside their Salesforce platform skills. It is increasingly requested by enterprise clients who want assurance that their Salesforce developers can write maintainable, modern JavaScript code and not just copy patterns from Trailhead.
Exam Blueprint and Topic Distribution
| Topic Domain | Weight |
|---|---|
| Variables, Types, and Collections | 23% |
| Objects, Functions, and Classes | 25% |
| Browser and Events | 17% |
| Debugging and Error Handling | 7% |
| Asynchronous Programming | 13% |
| Server-Side JavaScript | 8% |
| Testing | 7% |
Objects, Functions, and Classes (25%) and Variables, Types, and Collections (23%) together make up nearly half the exam. These foundational JavaScript language topics are where candidates with weak JavaScript fundamentals lose the most points.
Variables, Types, and Collections (23%)
Variable Declarations: var, let, const
The distinction between var, let, and const is the most fundamental JavaScript concept and appears throughout the exam.
| Declaration | Scope | Hoisting | Reassignable | Redeclarable |
|---|---|---|---|---|
var |
Function | Yes (hoisted to function top) | Yes | Yes |
let |
Block | Yes (not initialized, TDZ) | Yes | No |
const |
Block | Yes (not initialized, TDZ) | No | No |
Temporal Dead Zone (TDZ): let and const declarations are hoisted but not initialized. Accessing them before declaration throws a ReferenceError. This is a frequent exam topic.
console.log(x); // undefined (var hoisted and initialized)
var x = 5;
console.log(y); // ReferenceError: Cannot access 'y' before initialization
let y = 10;
Primitive Types
JavaScript has seven primitive types: string, number, bigint, boolean, undefined, null, and symbol. Understanding how primitives behave differently from objects is critical.
Type coercion: JavaScript's implicit type conversion is a frequent source of exam questions:
console.log(1 + '2'); // '12' (number coerced to string)
console.log(1 - '2'); // -1 (string coerced to number)
console.log(true + 1); // 2 (true coerced to 1)
console.log(null == undefined); // true (loose equality)
console.log(null === undefined); // false (strict equality)
Arrays and Destructuring
Modern JavaScript array methods are heavily tested:
const numbers = [1, 2, 3, 4, 5];
// map: creates new array with transformed values
const doubled = numbers.map(n => n * 2); // [2, 4, 6, 8, 10]
// filter: creates new array with elements passing test
const evens = numbers.filter(n => n % 2 === 0); // [2, 4]
// reduce: accumulates array to single value
const sum = numbers.reduce((acc, n) => acc + n, 0); // 15
// find: returns first matching element
const first = numbers.find(n => n > 3); // 4
// Array destructuring
const [first, second, ...rest] = numbers;
// first = 1, second = 2, rest = [3, 4, 5]
Objects, Functions, and Classes (25%)
Object Fundamentals
// Object creation
const person = { name: 'Alice', age: 30 };
// Property access
console.log(person.name); // dot notation
console.log(person['name']); // bracket notation (required for dynamic keys)
// Object destructuring
const { name, age } = person;
// Spread operator
const updated = { ...person, age: 31 }; // creates new object with overridden age
// Object.assign (mutates target)
Object.assign(person, { city: 'New York' });
Prototypal Inheritance
JavaScript uses prototype-based inheritance rather than classical class-based inheritance. Understanding the prototype chain is required for several exam questions.
function Animal(name) {
this.name = name;
}
Animal.prototype.speak = function() {
return `${this.name} makes a sound.`;
};
function Dog(name) {
Animal.call(this, name); // call parent constructor
}
Dog.prototype = Object.create(Animal.prototype);
Dog.prototype.constructor = Dog;
ES6 Classes
ES6 classes are syntactic sugar over prototypal inheritance. The exam tests both the class syntax and the underlying prototype mechanism.
class Animal {
constructor(name) {
this.name = name;
}
speak() {
return `${this.name} makes a sound.`;
}
static create(name) { // static method on class, not instance
return new Animal(name);
}
}
class Dog extends Animal {
constructor(name, breed) {
super(name); // must call super before using 'this'
this.breed = breed;
}
speak() {
return `${this.name} barks.`;
}
}
Closures and Scope
Closures -- functions that retain access to their outer function's scope even after the outer function has returned. This is one of the most tested and most misunderstood JavaScript concepts.
function counter() {
let count = 0;
return {
increment: () => ++count,
decrement: () => --count,
value: () => count
};
}
const myCounter = counter();
myCounter.increment(); // 1
myCounter.increment(); // 2
myCounter.value(); // 2
"Closures trip up candidates who have used JavaScript only in framework contexts. If you have only written LWC or React components, you may have used closures without understanding them. The JavaScript Developer I exam requires you to understand the mechanism." -- JavaScript Developer I Trailhead Superbadge documentation
this Context
The value of this in JavaScript is determined by how a function is called, not where it is defined. This is a major source of exam questions.
const obj = {
name: 'Alice',
regular: function() { return this.name; }, // 'Alice' when called as obj.regular()
arrow: () => { return this.name; } // undefined: arrow captures outer 'this'
};
// Explicit binding
function greet() { return `Hello, ${this.name}`; }
greet.call({ name: 'Bob' }); // 'Hello, Bob'
greet.apply({ name: 'Carol' }); // 'Hello, Carol'
const boundGreet = greet.bind({ name: 'Dave' });
boundGreet(); // 'Hello, Dave'
Asynchronous Programming (13%)
Asynchronous patterns are essential in JavaScript development and are tested thoroughly.
Promises
// Creating a promise
const fetchData = new Promise((resolve, reject) => {
setTimeout(() => {
const success = true;
if (success) {
resolve({ data: 'result' });
} else {
reject(new Error('Fetch failed'));
}
}, 1000);
});
// Consuming a promise
fetchData
.then(result => console.log(result.data))
.catch(error => console.error(error.message))
.finally(() => console.log('Done'));
// Promise.all: resolves when all promises resolve
Promise.all([promise1, promise2, promise3])
.then(results => console.log(results));
// Promise.allSettled: resolves when all promises settle (resolve or reject)
Promise.allSettled([promise1, promise2])
.then(results => results.forEach(r => console.log(r.status)));
async/await
async/await is syntactic sugar over Promises that makes asynchronous code look synchronous.
async function loadUser(id) {
try {
const response = await fetch(`/api/users/${id}`);
const user = await response.json();
return user;
} catch (error) {
console.error('Failed to load user:', error);
throw error; // re-throw for caller to handle
}
}
Key exam point: await can only be used inside async functions. An async function always returns a Promise, even if you return a non-Promise value.
Event Loop
The JavaScript event loop determines execution order for synchronous code, microtasks (Promises), and macrotasks (setTimeout, setInterval).
Execution order: Synchronous code > Microtasks (Promise callbacks) > Macrotasks (setTimeout)
console.log('1');
setTimeout(() => console.log('2'), 0);
Promise.resolve().then(() => console.log('3'));
console.log('4');
// Output: 1, 4, 3, 2
Browser and Events (17%)
The DOM and Event Handling
While Salesforce LWC abstracts direct DOM manipulation, the exam tests knowledge of browser DOM APIs and event handling mechanisms.
// DOM selection
const element = document.getElementById('myId');
const elements = document.querySelectorAll('.myClass');
// Event listeners
element.addEventListener('click', function(event) {
console.log(event.target); // element that triggered the event
console.log(event.currentTarget); // element the listener is on
event.preventDefault(); // prevent default browser behavior
event.stopPropagation(); // stop event bubbling
});
Event Propagation
Bubbling: Events bubble up from the target element through parent elements to the document root. Most events bubble; focus does not.
Capturing: The initial phase where the event travels down from the document to the target. Add a third parameter true to addEventListener to handle events in the capturing phase.
Event Delegation: Attaching a single event listener to a parent element to handle events from multiple children. This is an important performance pattern.
Testing (7%)
Jest Testing Framework
Salesforce's recommended testing framework for LWC is Jest. The exam tests basic Jest syntax and testing patterns.
// Unit test example
describe('Calculator', () => {
test('adds two numbers correctly', () => {
expect(add(2, 3)).toBe(5);
});
test('handles negative numbers', () => {
expect(add(-1, 1)).toBe(0);
});
});
// Mock functions
const mockCallback = jest.fn();
mockCallback('arg1');
expect(mockCallback).toHaveBeenCalledWith('arg1');
expect(mockCallback).toHaveBeenCalledTimes(1);
Testing Principles
- Unit tests: Test individual functions or components in isolation
- Mocking: Replace external dependencies with controlled test doubles
- Test coverage: Measure which code paths are exercised by tests
- Test-driven development (TDD): Write tests before implementation
Debugging and Error Handling (7%)
JavaScript Error Types
| Error Type | Cause |
|---|---|
SyntaxError |
Code that cannot be parsed |
ReferenceError |
Accessing undefined variable |
TypeError |
Operation on wrong data type |
RangeError |
Numeric value out of range |
URIError |
Invalid URI functions usage |
try/catch/finally
function parseJSON(str) {
try {
return JSON.parse(str);
} catch (error) {
if (error instanceof SyntaxError) {
console.error('Invalid JSON:', error.message);
return null;
}
throw error; // re-throw unexpected errors
} finally {
console.log('parseJSON completed'); // always runs
}
}
Frequently Asked Questions
Do I need Salesforce experience to take the JavaScript Developer I exam? The JavaScript Developer I exam primarily tests core JavaScript language knowledge. You need to understand how JavaScript concepts apply within the Salesforce LWC context, but the majority of the exam does not require Salesforce platform knowledge. Candidates with strong JavaScript skills but limited Salesforce experience can pass, though understanding LWC context is helpful for the browser and events domain.
How does JavaScript Developer I relate to Platform Developer I? Platform Developer I tests Apex, LWC basics, and Salesforce development patterns. JavaScript Developer I tests JavaScript language depth independently. They complement each other: PDI shows you can build Salesforce applications; JSD I shows you can write quality JavaScript within those applications. Many full-stack Salesforce developers pursue both certifications.
What is the recommended preparation path for JavaScript Developer I? Complete Salesforce's official Trailhead path for JavaScript Developer I preparation, which includes modules on modern JavaScript, asynchronous programming, and testing. Supplement with a JavaScript fundamentals course (Eloquent JavaScript, JavaScript.info, or Kyle Simpson's You Don't Know JS series). Practice with a Jest-based LWC testing setup to connect JavaScript knowledge to the Salesforce context.
References
- Salesforce. "Salesforce Certified JavaScript Developer I Exam Guide." Trailhead.salesforce.com, 2024.
- Salesforce Trailhead. "JavaScript Developer I Certification Prep Trail." trailhead.salesforce.com, 2024.
- Mozilla Developer Network. "JavaScript Reference." developer.mozilla.org, 2024.
- Simpson, Kyle. You Don't Know JS: Scope and Closures. O'Reilly Media, 2020.
- Haverbeke, Marijn. Eloquent JavaScript, Third Edition. No Starch Press, 2018.
- Meta Open Source. "Jest Testing Framework Documentation." jestjs.io, 2024.
- ECMA International. "ECMAScript 2024 Language Specification." ecma-international.org, 2024.
