JS-Dev-101 Certification Exam Guide + Practice Questions

Home / Salesforce / JS-Dev-101

Comprehensive JS-Dev-101 certification exam guide covering exam overview, skills measured, preparation tips, and practice questions with detailed explanations.

JS-Dev-101 Exam Guide

This JS-Dev-101 exam focuses on practical knowledge and real-world application scenarios related to the subject area. It evaluates your ability to understand core concepts, apply best practices, and make informed decisions in realistic situations rather than relying solely on memorization.

This page provides a structured exam guide, including exam focus areas, skills measured, preparation recommendations, and practice questions with explanations to support effective learning.

 

Exam Overview

The JS-Dev-101 exam typically emphasizes how concepts are used in professional environments, testing both theoretical understanding and practical problem-solving skills.

 

Skills Measured

  • Understanding of core concepts and terminology
  • Ability to apply knowledge to practical scenarios
  • Analysis and evaluation of solution options
  • Identification of best practices and common use cases

 

Preparation Tips

Successful candidates combine conceptual understanding with hands-on practice. Reviewing measured skills and working through scenario-based questions is strongly recommended.

 

Practice Questions for JS-Dev-101 Exam

The following practice questions are designed to reinforce key JS-Dev-101 exam concepts and reflect common scenario-based decision points tested in the certification.

Question#1

A developer wants to use a module named universalContainerslib and then call functions from it.
How should a developer import every function from the module and then call the functions foo and bar?

A. import * as lib from '/path/universalContainerslib.js'; lib.foo(); lib.bar();
B. import * from '/path/universalContainerslib.js'; universalContainerslib.foo(); universalContainerslib.bar();
C. import all from '/path/universalContainerslib.js'; universalContainerslib.foo(); universalContainerslib.bar();
D. import {foo, bar} from '/path/universalContainerslib.js'; foo(); bar();

Explanation:
import * as lib from '...' imports all named exports from the module into the namespace object lib.
You then call:
lib.foo();
lib.bar();
Option D correctly imports only foo and bar, not every function. The question explicitly says “import every function… and then call foo and bar”, so A best matches.
Options B and C are invalid syntax or reference the wrong identifier.

Question#2

A developer is required to write a function that calculates the sum of elements in an array but is getting undefined every time the code is executed.
The developer needs to find what is missing in the code below.
01 const sumFunction = arr => {
2 return arr.reduce((result, current) => {
3 //
4 result += current;
5 //
6 }, 10);
7 };
Which line replacement makes the code work as expected?

A. 03 if(arr.length == 0) { return 0; }
B. 04 result = result + current;
C. 02 arr.map((result, current) => {
D. 05 return result;

Explanation:
In a reduce callback, you must return the new accumulator value.
Currently:
(result, current) => {
result += current;
// no return
}
This returns undefined each time, so the accumulator becomes undefined on the next iteration, leading to incorrect results.
Fix by returning result:
const sumFunction = arr => {
return arr.reduce((result, current) => {
result += current;
return result; // line 05
}, 10);
};
Option D correctly adds the return.
Options A/B/C do not fix the missing return in the reducer and therefore do not resolve the core issue.

Question#3

Refer to the code below:
const searchText = 'Yay! Salesforce is amazing!';
let result1 = searchText.search(/sales/i);
let result2 = searchText.search(/sales/);
console.log(result1);
console.log(result2);
After running this code, which result is displayed on the console?

A. 5 undefined
B. 5 0
C. true false
D. 5 -1

Explanation:
Comprehensive and Detailed Explanation From Exact Extract JavaScript Knowledge:
String: "Yay! Salesforce is amazing!"
Index positions:
'Y' at 0, 'a' at 1, 'y' at 2, '!' at 3, space at 4, 'S' at 5, 'a' at 6, 'l' at 7, 'e' at 8, 's' at 9, etc.
Substring "Sales" starts at index 5.
String.prototype.search with a regex returns the index of the first match or -1 if there is no match. searchText.search(/sales/i);
/sales/i is case-insensitive because of the i flag.
It matches "Sales" beginning at index 5.
So result1 is 5.
searchText.search(/sales/);
/sales/ is case-sensitive.
It requires lowercase "sales".
The text has "Sales" with uppercase S, so this does not match.
search returns -1 when there is no match.
So result2 is -1.
Console output:
First log: 5
Second log: -1
Option D matches this.
Concepts: regex search, case sensitivity vs i flag, String.prototype.search return values.

Question#4

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?

A. server.catch('error) => { console.log('ERROR', error); });
B. server.error('error) => { console.log('ERROR', error); });
C. server.on('error', (error) => { console.log('ERROR', error); });
D. try { server.start(); } catch(error) { console.log('ERROR', error); }

Explanation:
Comprehensive and Detailed Explanation From Exact Extract JavaScript Knowledge 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.

Question#5

Given the code:
01 function GameConsole(name) {
2 this.name = name;
3 }
4
5 GameConsole.prototype.load = function(gamename) {
6 console.log('${this.name} is loading a game: ${gamename}....');
7 }
8
9 function Console16bit(name) {
10 GameConsole.call(this, name);
11 }
12
13 Console16bit.prototype = Object.create(GameConsole.prototype);
14
15 // insert code here
16 console.log('${this.name} is loading a cartridge game: ${gamename}....');
17 }
18
19 const console16bit = new Console16bit('SNEGeneziz');
20 console16bit.load('Super Monic 3x Force');
What should a developer insert at line 15?

A. Console16bit = Object.create(GameConsole.prototype).load = function(gamename) {
B. Console16bit.prototype.load(gamename) = function() {
C. Console16bit.prototype.load(gamename) {
D. Console16bit.prototype.load = function(gamename) {

Explanation:
Comprehensive and Detailed Explanation From Exact Extract JavaScript Knowledge A subclass created by:
Console16bit.prototype = Object.create(GameConsole.prototype); inherits all prototype methods from GameConsole, including load.
To override the inherited method, the correct syntax is to assign a new function to the method name on the prototype:
Console16bit.prototype.load = function(gamename) {
console.log(`${this.name} is loading a cartridge game: ${gamename}....`);
};
Why the other options are wrong:
A assigns something to the constructor function itself, not to the prototype method. Invalid.
B attempts to call a function in the left-hand side of an assignment; invalid syntax.
C also uses invalid syntax―prototype methods cannot be defined this way.
D is the correct definition of a prototype method override.
JavaScript Knowledge Reference (text-only)
Methods are overridden by assigning functions to Subclass.prototype.methodName.
Object.create() establishes prototype inheritance.
Constructor functions require prototype method attachment using assignment syntax.

Disclaimer

This page is for educational and exam preparation reference only. It is not affiliated with Salesforce, Salesforce Developer, or the official exam provider. Candidates should refer to official documentation and training for authoritative information.

Exam Code: JS-Dev-101Q & A: 149 Q&AsUpdated:  2026-03-02

  Access Additional JS-Dev-101 Practice Resources