Key details for this exam, checked against the published exam outline
Each question shows the correct answer and an explanation of why it is right
Value of:
true + 3 + '100' + null
The correct answer is A.
JavaScript evaluates the expression from left to right:
true + 3 + '100' + null
Step 1:
true + 3
In numeric addition, true is converted to:
1
So:
true + 3
becomes:
1 + 3
Result:
4
Step 2:
4 + '100'
Because one operand is a string, JavaScript performs string concatenation instead of numeric addition.
So:
4 + '100'
becomes:
'4100'
Step 3:
'4100' + null
Again, because one operand is already a string, JavaScript converts null into the string:
'null'
So the final result is:
'4100null'
Execution summary:
true + 3 + '100' + null
// 1 + 3 + '100' + null
// 4 + '100' + null
// '4100' + null
// '4100null'
Therefore, the verified answer is A.
A class was written to represent regular items and sale items. Code:
01 let regItem = new Item('Scarf', 55);
02 let saleItem = new SaleItem('Shirt', 80, .1);
03 Item.prototype.description = function() { return 'This is a ' + this.name; }
04 console.log(regItem.description());
05 console.log(saleItem.description());
06
07 SaleItem.prototype.description = function() { return 'This is a discounted ' + this.name; }
08 console.log(regItem.description());
09 console.log(saleItem.description());
What is the output?
At line 03, the developer assigns:
Item.prototype.description = function() { return 'This is a ' + this.name; }
This affects all objects whose prototype chain includes Item.prototype.
regItem inherits from Item gets this method.
saleItem, as an instance of SaleItem, also inherits Item.prototype (since SaleItem uses prototype inheritance from Item), so it also has this method at this moment.
Outputs at lines 04 and 05:
regItem.description() 'This is a Scarf'
saleItem.description() 'This is a Shirt'
At line 07, the developer overrides the method on SaleItem.prototype:
SaleItem.prototype.description = function() {
return 'This is a discounted ' + this.name;
}
From this point:
regItem still uses the Item.prototype version
saleItem uses the overridden SaleItem.prototype version
Outputs at lines 08 and 09:
regItem.description() 'This is a Scarf'
saleItem.description() 'This is a discounted Shirt'
Combining all results:
This is a Scarf
This is a Shirt
This is a Scarf
This is a discounted Shirt
This matches option B.
JavaScript Knowledge Reference (text-only)
Objects created from constructor functions use prototype chaining.
Overriding a subclass prototype method does not affect the parent class prototype.
Instances inherit the most specific version of the method on their prototype chain.
Considering type coercion, what does the following expression evaluate to?
true + '13' + NaN
Expression:
true + '13' + NaN
The + operator is left-associative, so evaluation order:
true + '13'
When one operand is a string, + performs string concatenation.
true is converted to string 'true'.
'true' + '13' 'true13'.
Result from step 1 with NaN:
'true13' + NaN
Again, one operand is a string, so concatenation.
NaN is converted to string 'NaN'.
'true13' + 'NaN' 'true13NaN'.
Final value: 'true13NaN'.
So A is correct.
Why others are wrong:
B: '113NaN' would require true to coerce to 1 first and no string to be present, which is not the case because '13' forces string concatenation.
C: 14 would require pure numeric addition, which is not the case once a string is involved.
D: 'true13' ignores the final + NaN part.
Concepts: type coercion with +, boolean to string, NaN to string, left-associative evaluation.
A team at Universal Containers works on a big project and uses Yarn to deal with the project's dependencies. A developer added a dependency to manipulate dates and pushed the updates to the remote repository. The rest of the team complains that the dependency does not get downloaded when they execute yarn.
What could be the reason for this?
If the dependency was added as a dev dependency (yarn add --dev), it goes into devDependencies.
When NODE_ENV=production, Yarn (and npm) typically skip devDependencies on install.
Thus the package doesn't get installed for other team members in a production environment.
YARN_ENV is not a standard variable, --save is npm syntax (and Yarn saves by default), and --add is not how Yarn works (the command itself is yarn add).
What are two unique features of fat-arrow functions compared to normal function definitions?
Arrow functions have two defining characteristics:
Implicit return when written as a single expression:
const fn = () => 5; // returns 5 automatically
This is unique to arrow functions A is correct.
Lexical this binding:
Arrow functions do not create their own this.
Instead, they use the this value from the surrounding scope B is correct.
Incorrect options:
C is false: There is no special argument called parentThis.
D is the opposite of arrow function behavior:
Normal functions create their own this; arrow functions do not.
JavaScript Knowledge Reference (text-only)
Arrow functions have lexical this binding.
Arrow functions support implicit return for single expressions.
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?
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.
Exam domains verified against: Official Salesforce JS-Dev-101 exam guide, last checked October 2026.
Write code to create and initialize variables correctly, working with strings, numbers, and dates. Demonstrate understanding of type coercion effects, truthy and falsey evaluations, array data manipulation, and JSON object operations.
Apply object, function, and class implementations to meet business requirements. Understand how to use JavaScript modules and decorators, and analyze variable scope and execution flow within code blocks.
Sample question from this domain above: Q6
Use events, event handlers, and event propagation to meet business requirements. Evaluate and manipulate the DOM, use browser developer tools to investigate code behavior, and work with browser specific APIs.
Sample question from this domain above: Q5
Handle errors properly in code scenarios. Use the browser console and breakpoints to debug code and trace application behavior.
Apply asynchronous programming concepts including callbacks, promises, and async/await. Understand the event loop and how it controls execution flow and determines outcomes.
Sample question from this domain above: Q1
Infer which Node.js implementation, CLI command, and library or framework fit a given scenario. Distinguish which Node.js package management solution is most appropriate and know the core Node.js modules.
Sample question from this domain above: Q2
Analyze unit tests alongside code blocks to identify where tests are ineffective. Modify tests to make them more effective at validating code reliability.
Common questions about the exam itself