JS-Dev-101 Exam Preparation Material | Salesforce Certified JavaScript Developer

Prepare for the JS-Dev-101 with reliable study materials, practice questions, and key exam insights.

Prepare for the JS-Dev-101 Salesforce Certified JavaScript Developer exam with CertQueen's independently developed study resources. Review important concepts, practice scenario-based questions, and use clear explanations to identify areas that require further study.

Question#1

CRefer to the code below:
```javascript
let strNumber = '12345';
```
Which code snippet shows a correct way to convert this string to an integer?

A. let numberValue = Integer(strNumber);
B. let numberValue = textvalue.cornteger();
C. let numberValue = Number(textVelue);
D. let numberValue = (stunber) textveluer

Question#2

Universal Containers (UC) just launched a new landing page, but users complain that the website is slow. A developer found some functions that might cause this problem. To verify this, the developer decides to execute everything and log the time each of these three suspicious functions consumes.
1 console.time('Performance');
2
3 maybeAHeavyFunction();
4
5 thisCouldTakeTooLong();
6
7 orMaybeThisOne();
8
9 console.endTime('Performance');
Which function can the developer use to obtain the time spent by every one of the three functions?

A. console.timeLog()
B. console.trace()
C. console.timeStamp()
D. console.getTime()

Explanation:
Comprehensive and Detailed Explanation From Exact Extract JavaScript Knowledge: JavaScript consoles (browsers and Node) provide timing utilities: console.time(label) C starts a timer with the given label. console.timeEnd(label) C stops the timer and logs the total elapsed time. console.timeLog(label) C logs the current elapsed time without stopping the timer.
To measure the time taken by each function separately while still using a single overall timer, you can log intermediate times:
console.time('Performance');
maybeAHeavyFunction();
console.timeLog('Performance', 'after maybeAHeavyFunction');
thisCouldTakeTooLong();
console.timeLog('Performance', 'after thisCouldTakeTooLong');
orMaybeThisOne();
console.timeLog('Performance', 'after orMaybeThisOne');
console.timeEnd('Performance');
Each console.timeLog('Performance') call prints the elapsed time since console.time('Performance') was started, so you can infer how long each function took.
Note: console.endTime in the original snippet is incorrect; the real method is console.timeEnd.
Why other options are incorrect:
B. console.trace()
Prints a stack trace, not timing information.
C. console.timeStamp()
Used with browser performance tools; it does not directly show elapsed times like timeLog or timeEnd.
D. console.getTime()
Not a standard console method.
Thus, the function that can be used to obtain timing between calls is:
Answer A
Study Guide Concepts:
console.time, console.timeLog, console.timeEnd
Measuring performance and intermediate timings
Standard console debugging API methods

Question#3

A developer creates a simple webpage with an input field.
When a user enters text and clicks the button, the actual value must be displayed in the console:
HTML:
<input type="text" value="Hello" name="input">
<button type="button">Display</button>
JavaScript:
01 const button = document.querySelector('button');
02 button.addEventListener('click', () => {
3 const input = document.querySelector('input');
4 console.log(input.getAttribute('value'));
5 });
When the user clicks the button, the output is always "Hello".
What needs to be done to make this code work as expected?

A. Replace line 02 with button.addCallback("click", function() {
B. Replace line 03 with const input = document.getElementByIdName('input');
C. Replace line 04 with console.log(input.value);
D. Replace line 02 with button.addEventListener("onclick", function() {

Explanation:
Comprehensive and Detailed Explanation From Exact Extract JavaScript Knowledge getAttribute('value')
This returns the initial HTML attribute, not the live, updated value.
Even if the user edits the text, the value attribute remains "Hello" because HTML attributes do not update dynamically.
Input elements have a property value that always reflects the live current text inside the field.
So:
input.value
returns the user-entered value.
Therefore, line 04 must use the property, not the attribute:
console.log(input.value);
This ensures the updated input value is displayed.
JavaScript knowledge references (text-only)
HTML attributes are static and retrieved using getAttribute().
DOM element properties (like value) represent the current live state.
Input value changes update the .value property, not the attribute.

Question#4

01 function changeValue(obj) {
2 obj.value = obj.value / 2;
3 }
4 const objA = { value: 10 };
5 const objB = objA;
6
7 changeValue(objB);
8 const result = objA.value; What is the value of result?

A. undefined
B. 5
C. NaN
D. 10

Explanation:
Comprehensive and Detailed Explanation From Exact Extract JavaScript Knowledge objA is created with:
{ value: 10 } objB = objA;
Objects in JavaScript are assigned by reference, not copied. So objA and objB refer to the same object in memory.
The function: changeValue(obj) { obj.value = obj.value / 2;
}
When called as changeValue(objB), it updates the value property of the shared object:
value = 10 / 2 → 5
Therefore:
objA.value === 5
Because objA and objB refer to the same object, the change is reflected in both.
JavaScript Knowledge Reference (text-only)
Objects are stored and passed by reference.
Mutating an object inside a function mutates the original object.

Question#5

Given the code below:
01 setTimeout(() => {
2 console.log(1);
3 }, 1100);
4 console.log(2);
5 new Promise((resolve, reject) => {
6 setTimeout(() => {
7 reject(console.log(3));
8 }, 1000);
9 }).catch(() => {
10 console.log(4);
11 });
12 console.log(5);
What is logged to the console?

A. 25341
B. 12435
C. 12534
D. 21435

Explanation:
Comprehensive and Detailed Explanation From JavaScript Knowledge:
We must track synchronous code, setTimeout callbacks (macrotasks), and Promise rejection handling (microtasks).
Step-by-step:
Synchronous code first:
Line 01C03: Schedules a timeout at 1100 ms: logs 1 (later).
Line 04: console.log(2); → logs 2.
Lines 05C09: Construct a new Promise.
The executor runs immediately.
Inside it, another setTimeout is set for 1000 ms:
setTimeout(() => {
reject(console.log(3));
}, 1000);
Line 09C11: .catch(() => { console.log(4); }) attached to the promise.
Line 12: console.log(5); → logs 5.
So after all synchronous code, the console has:
2
5
At 1000 ms: inner setTimeout fires
The callback:
()=>{
reject(console.log(3));
}
Inside:
console.log(3) runs first, logging 3.
console.log(3) returns undefined.
Then reject(undefined) is called.
So at about 1000 ms, we log:
3
When the promise is rejected:
The .catch handler is scheduled as a microtask.
After the current macrotask (the timeout callback) completes, the microtask queue runs.
Thus .catch(() => { console.log(4); }) runs shortly after, in the same 1000 ms tick.
So immediately after 3, the catch handler logs:
4
Now the logs in order are:
2
5
3
4
At 1100 ms: outer setTimeout fires
The callback from line 01 runs:
console.log(1);
Logs: 1.
Final log order:
2 (line 4, sync)
5 (line 12, sync)
3 (1000 ms timeout, then inside logs before reject)
4 (promise catch microtask after rejection)
1 (1100 ms timeout)
Concatenated: 25341.
Therefore, the correct option is:
Answer A
Study Guide / Concept Reference (no links):
Event loop: call stack, macrotask queue (timers), microtask queue (promises)
setTimeout scheduling and ordering
Promise rejection, .catch, and microtasks
Evaluation order of function arguments (reject(console.log(3)))

Exam Code: JS-Dev-101
Q & A: 149 Q&As         Updated:  Nov 02,2026

 

 Access Complete JS-Dev-101 Preparation Material

What This JS-Dev-101 Study Resource Helps You Do

Review Key Concepts

Review the technologies, products, processes, and practical skills covered by the current JS-Dev-101 exam objectives.

Practice Scenario-Based Questions

Work through independently developed questions designed to strengthen your understanding of technical scenarios and decision-making.

Identify Knowledge Gaps

Use your results and the provided explanations to find weaker areas and focus your study more effectively.

How to Use This JS-Dev-101 Preparation Material

Review the Exam Scope

Start by reviewing the topics covered by the JS-Dev-101 exam. Compare them with the official exam objectives to understand the required technologies, operational tasks, and practical skills, then identify the areas that deserve the most attention.

Practice Independently

Complete a focused set of practice questions for each topic. On your first attempt, avoid referring to notes, answers, or other study resources so that you can evaluate your current understanding more accurately.

Study the Explanations

Review the answers and explanations after completing each practice session. Understand why the correct option is appropriate for the given scenario and why the other options may be incorrect or less suitable.

Close Knowledge Gaps

Keep track of incorrect answers, unfamiliar concepts, and weaker knowledge areas. Review these topics using official documentation and practical experience, then answer the related questions again to reinforce your understanding and monitor your progress.

Independent JS-Dev-101 Preparation Resource

CertQueen independently develops its certification study materials for educational purposes. The practice questions are not copied from, recalled from, or presented as live or official exam questions.

CertQueen is not affiliated with, endorsed by, sponsored by, or authorized by any certification provider. Certification names, exam codes, product names, and related trademarks are the property of their respective owners and are referenced only for identification and educational purposes.

Exam Code: JS-Dev-101
Q & A: 149 Q&As
Updated:  Nov 02,2026

 

 Access Complete JS-Dev-101 Preparation Material