Practice questions for the Salesforce Certified JavaScript Developer exam, organised by the official exam guide sections and weights, with explanations and links to the documentation. See your readiness per section. Free to start.
Practice for the Salesforce Certified JavaScript Developer exam, weighted by the official exam guide.
For developers who build front-end or back-end JavaScript applications for the web stack and want to prove core JavaScript skills used with Lightning Web Components and Node.js.
The real exam: 60 questions (5 unscored), 105 minutes. Passing score: 65%.
const total = 10; total = 20;
What happens when this code runs?
Answer: A. A TypeError is thrown
A const binding can't be reassigned, so the second line throws a TypeError (Assignment to constant variable) at run time. The code parses fine, so it isn't a SyntaxError, and the value is never silently kept or changed.
function counter() { let count = 0; return () => ++count; } const next = counter(); next(); console.log(next());
What is logged?
Answer: A. 2
The returned arrow function is a closure that keeps access to count from counter's scope. Each call increments the same count, so the second call returns 2.
A click handler on a button must stop the click from reaching listeners on the button's parent elements. What should it call?
Answer: A. event.stopPropagation()
stopPropagation() stops the event moving further through the capturing and bubbling phases. preventDefault() stops the browser's default action but not propagation, and stopDefault() doesn't exist. Returning false from an addEventListener handler has no effect.
Start practising JavaScript Developer
60 questions (5 unscored) in 105 minutes. Passing score: 65%.
For developers who build front-end or back-end JavaScript applications for the web stack and want to prove core JavaScript skills used with Lightning Web Components and Node.js.
The exam guide has 7 sections: 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%).
Answer practice questions organised by the official exam guide sections and weights. Every question has an explanation and a link to the documentation, and CramForce shows your readiness per section. You can try a few questions without an account, and keep practising free once you sign up.