Salesforce JS-Dev-101認証された練習解答、必ずあなたを試験合格させる![2026]
有効な合格方法Salesforce DevelopersのJS-Dev-101試験問題集
Salesforce JS-Dev-101 認定試験の出題範囲:
| トピック | 出題範囲 |
|---|---|
| トピック 1 |
|
| トピック 2 |
|
| トピック 3 |
|
| トピック 4 |
|
| トピック 5 |
|
質問 # 43
developer publishes a new version of a package with new features that do not break backward compatibility. The previous version number was 1.1.3.
Following semantic versioning format, what should the new package version number be?
- A. 1.1.4
- B. 1.2.3
- C. 1.2.0
- D. 2.0.0
正解:D
質問 # 44
A developer has the function, shown below, that is called when a page loads.
Where can the developer see the log statement after loading the page in the browser?
- A. On the terminal console running the web server
- B. On the webpage console log
- C. On the browser JavaScriptconsole
- D. In the browser performance tools log
正解:C
質問 # 45
Refer to the code below:
let productSKU = '8675309';
A developer has a requirement to generate SKU numbers that are always 19 characters long, starting with 'sku', and padded with zeros.
Which statement assigns the value sku000000008675309?
- A. productSKU = productSKU.padStart(19, '0').padStart('sku');
- B. productSKU = productSKU.padStart(16, '0').padStart(19, 'sku');
- C. productSKU = productSKU.padEnd(16, '0').padStart(19, 'sku');
- D. productSKU = productSKU.padEnd(16, '0').padStart('sku');
正解:B
解説:
Comprehensive and Detailed Explanation From Exact Extract JavaScript knowledge:
We start with:
let productSKU = '8675309';
The requirement:
Final SKU string:
Length: 19 characters.
Starts with 'sku'.
Remaining characters are digits padded with zeros on the left (to reach total length).
We can use String.prototype.padStart and String.prototype.padEnd:
str.padStart(targetLength, padString)
If str.length < targetLength, it adds padString to the start until the length is targetLength.
str.padEnd(targetLength, padString)
Similar, but adds padString to the end.
We want a pattern like:
First, pad the numeric part out to a fixed length with zeros.
Then, pad to total length with 'sku' at the start.
Analyze Option B
productSKU = productSKU.padStart(16, '0').padStart(19, 'sku');
Step 1: productSKU.padStart(16, '0')
Initial productSKU is '8675309' (length 7).
After padStart(16, '0'), we pad zeros on the left to reach length 16.
We need 16 − 7 = 9 zeros:
Result after step 1:
productSKU === '0000000008675309' // length 16
Step 2: .padStart(19, 'sku')
Now productSKU has length 16.
We call padStart(19, 'sku'):
We need 19 − 16 = 3 extra characters.
The pad string 'sku' is exactly 3 characters, so it is added as-is at the start.
Result after step 2:
productSKU === 'sku0000000008675309' // length 19
This satisfies:
Length 19.
Starts with 'sku'.
Remaining characters are zeros plus the original digits, i.e. a zero-padded numeric section.
While the literal sample sku000000008675309 in the text has a slightly different count of zeros, Option B follows the requirement pattern:
3 characters of 'sku'
Numeric part padded with zeros to make 16 characters total for the numeric part
3 + 16 = 19 total characters
Option B matches the intended logic using padStart and padEnd.
Why the other options are incorrect
Option A:
productSKU = productSKU.padEnd(16, '0').padStart('sku');
padEnd(16, '0') produces '8675309000000000' (original number followed by zeros).
padStart('sku') is invalid usage:
padStart takes a numeric target length as the first argument, not a string.
Passing 'sku' as the first argument leads to type coercion that does not achieve the intended behavior.
This will not reliably produce the desired SKU.
Option C:
productSKU = productSKU.padEnd(16, '0').padStart(19, 'sku');
First padEnd(16, '0') from '8675309' gives '8675309000000000' (length 16, zeros at the end).
Then padStart(19, 'sku') adds 3 chars 'sku' at the front:
Result: 'sku8675309000000000'.
This string starts with 'sku', but the zeros are at the end of the digits, not padding the numeric part on the left as desired.
Option D:
productSKU = productSKU.padStart(19, '0').padStart('sku');
First padStart(19, '0') pads zeros at the left to make the length 19.
Then padStart('sku') again incorrectly uses a string where a numeric targetLength is required.
This will not produce the correct SKU format.
Therefore, the only option that correctly uses padStart to create a 16-character zero-padded numeric portion and then a 19-character string starting with 'sku' is:
Reference / Study Guide concepts (no links):
String.prototype.padStart(targetLength, padString)
String.prototype.padEnd(targetLength, padString)
String length calculations
Left-padding numeric strings with zeros
Building prefixed identifiers with fixed total length
質問 # 46
At Universal Containers, every team has its own way of copying JavaScript objects. The code snippet shows an implementation from one team:
01 function Person() {
02 this.firstName = "John";
03 this.lastName = "Doe";
04 this.name = () => {
05 console.log('Hello ${this.firstName} ${this.lastName}');
06 }
07 }
08
09 const john = new Person();
10 const dan = JSON.parse(JSON.stringify(john)); // (intended deep copy)
11 dan.firstName = 'Dan';
12 dan.name();
(Original line 10 is logically intended to be JSON.parse(JSON.stringify(john)) to perform a JSON clone.) What is the output of the code execution?
- A. Hello Dan Doe
- B. Hello John Doe
- C. Hello Dan
- D. TypeError: dan.name is not a function
正解:D
解説:
JSON.stringify(john) converts the john object into a JSON string.
When you JSON.parse that string back, you get a plain object:
Only data that can be represented in JSON is preserved (numbers, strings, booleans, arrays, plain objects).
Functions are not preserved and are dropped.
So dan is a plain object with properties firstName and lastName, but no name method.
Therefore, dan.name is undefined, and dan.name() throws:
TypeError: dan.name is not a function
The literal string interpolation inside console.log('Hello ${...}') is also wrong (single quotes), but the code never reaches that line.
________________________________________
質問 # 47
A developer is leading the creation of a new web server for their team that will fulfill API requests from an existing client. The team wants a web server that runs on Node.js, and they want to use the new web framework Minimalist.js. The lead developer wants to advocate for a more seasoned back-end framework that already has a community around it.
Which two frameworks could the lead developer advocate for?
- A. Gatsby
- B. Next
- C. Next.js
- D. Angular
正解:B、C
解説:
Comprehensive and Detailed Explanation From Exact Extract JavaScript Knowledge:
The question is about:
Web frameworks that run on Node.js
Used to build servers and APIs
With established communities.
From the given options:
Angular:
A front-end framework running in the browser, not a Node.js server framework.
Gatsby:
A React-based static site generator; uses Node tooling but is not primarily a Node server framework.
Next / Next.js:
Server-side rendering / full-stack frameworks built on Node.js and React.
Used to create both server-rendered pages and APIs.
They have active communities and are "seasoned" compared to a hypothetical Minimalist.js.
Although typical Node back-end frameworks would include Express.js, Koa, or NestJS, given the options provided, the best fits for server-side frameworks with Node.js and an ecosystem are:
Next (interpreted as Next.js)
Next.js
Thus, the correct pair from the list is B and D.
Concepts: Node.js web frameworks, server-side rendering, community-backed frameworks vs minimal/new frameworks.
________________________________________
質問 # 48
Refer to the following object:
01 const cat = {
02 firstName: 'Fancy',
03 lastName: 'Whiskers',
04 get fullName(){
05 return this.firstName + ' ' + this.lastName;
06 }
07 };
How can a developer access the fullName property for cat?
- A. cat.get.fullName
- B. cat.function.fullName()
- C. cat.fullName()
- D. cat.fullName
正解:D
解説:
fullName is defined as a getter:
get fullName() { ... }
Getters are accessed like properties, not like functions.
So:
cat.fullName; // "Fancy Whiskers"
No parentheses.
Why others are wrong:
A: cat.fullName() tries to call the returned string as a function.
B and C: These properties (get, function) do not exist; they are misinterpretations of syntax.
________________________________________
質問 # 49
Refer to the code below:
Considering that JavaScript is single-threaded, what is the output of line 08 after the code executes?
- A. 0
- B. 1
- C. 2
- D. 3
正解:C
質問 # 50
Refer to the code below:
const car = {
price:100,
getPrice:function(){
return this.price;
}
};
const customCar = Object.create(car);
customCar.price = 70;
delete customCar.price;const result = customCar.getPrice();
Whatis the value of result after the code executes?
- A. 0
- B. 1
- C. undefined
- D. null
正解:A
質問 # 51
Which two code snippets show working examples of a recursive function?
- A. let countingDown = function(startNumber) {
if (startNumber > 0) {
console.log(startNumber);
return countingDown(startNumber - 1);
} else { - B. const sumToTen = numVar => {
if (numVar < 0)
return;
return sumToTen(numVar + 1);
}; - C. function factorial(numVar) {
if (numVar < 0) return;
if (numVar === 0) return 1;
return numVar - 1;
} - D. const factorial = numVar => {
if (numVar < 0) return;
if (numVar === 0) return 1;
return numVar * factorial(numVar - 1);
};
正解:A、D
解説:
return startNumber;
}
};
(Note: Option D is shown here with corrected syntax: lowercase return and matching parentheses.) Explanation:
Comprehensive and Detailed Explanation From Exact Extract JavaScript knowledge:
A recursive function is a function that calls itself and has a base case to terminate the recursion.
Evaluate each option:
Option A:
const sumToTen = numVar => {
if (numVar < 0)
return;
return sumToTen(numVar + 1);
};
This function calls itself: sumToTen(numVar + 1) - so it is recursive.
However, the base condition is if (numVar < 0) return;.
If you call sumToTen(0):
numVar < 0 is false, so it calls sumToTen(1), then sumToTen(2), and so on, incrementing forever.
There is no condition to stop the recursion when numVar increases; it will eventually cause a stack overflow.
This code does not represent a properly working recursive function with a valid termination for increasing values and is not a good example of correct recursion.
Option B:
function factorial(numVar) {
if (numVar < 0) return;
if (numVar === 0) return 1;
return numVar - 1;
}
This function does not call itself anywhere.
It has conditional returns, but there is no recursive call such as factorial(numVar - 1).
Therefore, it is not recursive at all.
Option C:
const factorial = numVar => {
if (numVar < 0) return;
if (numVar === 0) return 1;
return numVar * factorial(numVar - 1);
};
This is a classic recursive factorial implementation.
It calls itself with a smaller argument: factorial(numVar - 1).
Base cases:
If numVar < 0, it simply returns (could be treated as invalid input).
If numVar === 0, it returns 1, which is the mathematical definition of 0! (zero factorial).
For positive integers, it correctly multiplies numVar by factorial(numVar - 1) until it reaches the base case.
This is a correct and working recursive function.
Option D (corrected):
let countingDown = function(startNumber) {
if (startNumber > 0) {
console.log(startNumber);
return countingDown(startNumber - 1);
} else {
return startNumber;
}
};
This function also calls itself: countingDown(startNumber - 1).
Base case:
When startNumber is not greater than 0 (i.e., 0 or negative), it returns startNumber and stops recursing.
For example, countingDown(3) would:
Log 3, call countingDown(2)
Log 2, call countingDown(1)
Log 1, call countingDown(0)
At 0, it hits the else branch and returns 0, ending the recursion.
This is a valid working recursive function structure (once syntax is corrected).
Therefore, the snippets that show working recursive functions are:
Answe r: C, D
Study Guide / Concept Reference (no links):
Definition of recursion: a function calling itself
Base case vs recursive step
Recursive factorial implementation
Recursive countdown example
Importance of a terminating condition to avoid infinite recursion
質問 # 52
Given the followingcode, what is the value of x?
let x = '15' + (10 * 2);
- A. 0
- B. 1
- C. 2
- D. 3
正解:D
質問 # 53
Considering type coercion, what does the following expression evaluate to?
true + '13' + NaN
- A. '113NaN'
- B. 0
- C. 'true13NaN'
- D. 'true13'
正解:C
解説:
Comprehensive and Detailed Explanation From Exact Extract JavaScript Knowledge:
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.
________________________________________
質問 # 54
A developer creates an object where its properties should be immutable and prevent properties from being added or modified.
Which method should be used to execute this businessrequirement ?
- A. Object.eval()
- B. Object.lock()
- C. Object.freeze()
- D. Object.const()
正解:C
質問 # 55
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 all from '/path/universalContainerslib.js';
universalContainerslib.foo();
universalContainerslib.bar(); - B. import {foo, bar} from '/path/universalContainerslib.js';
foo();
bar(); - C. import * from '/path/universalContainerslib.js';
universalContainerslib.foo();
universalContainerslib.bar(); - D. import * as lib from '/path/universalContainerslib.js';
lib.foo();
lib.bar();
正解:D
解説:
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.
________________________________________
質問 # 56
A developer uses a parsed JSON string to work with user information as in the block below:
01 const userInformation ={
02 " id " : "user-01",
03 "email" : "[email protected]",
04 "age" : 25
Which two options access the email attribute in the object?
Choose 2 answers
- A. userInformation.get("email")
- B. userInformation.email
- C. userInformation(email)
- D. userInformation("email")
正解:B、D
質問 # 57
Refer to the code below:
01 const server = require('server');
02 /* Insert code here */
A developer imports a library that creates a web server. Theimported library uses events and callbacks to start the servers Which code should be inserted at the line 03 to set up an event and start the web server ?
- A. server.on(' connect ' , ( port) => {console.log('Listening on ' , port) ;})
- B. serve(( port) => (
- C. Server.start ();
- D. server()
- E. console.log( 'Listening on ', port) ;
正解:A
質問 # 58
A developer wrote the following code:
01 let x = object.value;
02
03 try {
04 handleObjectValue(x);
05 } catch(error) {
06 handleError(error);
07 }
The developer has a getNextValue function to execute after handleObjectValue(), but does not want to execute getNextValue() if an error occurs. How can the developer change the code to ensure this behavior?
- A. 03 try {
04 handleObjectValue(x);
05 } catch(error) {
06 handleError(error);
07 }
08 getNextValue(); - B. 03 try {
04 handleObjectValue(x);
05 getNextValue();
06 } catch(error) {
07 handleError(error);
08 } - C. 03 try {
04 handleObjectValue(x);
05 } catch(error) {
06 handleError(error);
07 } then {
08 getNextValue();
09 } - D. 03 try {
04 handleObjectValue(x);
05 } catch(error) {
06 handleError(error);
07 } finally {
08 getNextValue();
09 }
正解:B
解説:
Comprehensive and Detailed Explanation From Exact Extract JavaScript Knowledge:
Requirement:
getNextValue() should run only if handleObjectValue(x) does not throw an error.
If an error occurs, handleError(error) should run, and getNextValue() should be skipped.
Option B:
try {
handleObjectValue(x);
getNextValue();
} catch (error) {
handleError(error);
}
Behavior:
If handleObjectValue(x) succeeds (no error):
Execution continues to getNextValue();.
If handleObjectValue(x) throws:
Control jumps directly to catch, getNextValue() is skipped.
handleError(error); is called.
This matches the requirement perfectly.
Why others are incorrect:
A: } then { is invalid JavaScript syntax.
C:
try {
handleObjectValue(x);
} catch (error) {
handleError(error);
}
getNextValue();
getNextValue() is called after the try...catch regardless of whether an error occurred. Not acceptable.
D: finally always runs:
try {
handleObjectValue(x);
} catch (error) {
handleError(error);
} finally {
getNextValue();
}
getNextValue() will execute in both success and error cases.
Therefore, the correct approach is B.
Concepts: try/catch control flow, finally semantics, placing code inside vs outside try/catch blocks.
________________________________________
質問 # 59
Refer tofollowing code:
class Vehicle {
constructor(plate) {
This.plate =plate;
}
}
Class Truck extends Vehicle {
constructor(plate, weight) {
//Missing code
This.weight = weight;
}
displayWeight() {
console.log('The truck ${this.plate} has a weight of${this.weight} lb.');}} Let myTruck = new Truck('123AB', 5000); myTruck.displayWeight(); Which statement should be added to line 09 for the code to display 'The truck 123AB has a weight of 5000lb.'?
- A. Super.plate =plate;
- B. super(plate);
- C. This.plate =plate;
- D. Vehicle.plate = plate;
正解:B
質問 # 60
A developer publishes a new version of a package with new features that do not break backward compatibility. The previous version number was 1.1.3.
Following semantic versioning formats, what should the new package version number be?
- A. 1.1.4
- B. 2.0.0
- C. 1.2.3
- D. 1.2.0
正解:D
質問 # 61
......
Salesforce JS-Dev-101事前試験練習テストはJPNTest:https://www.jpntest.com/shiken/JS-Dev-101-mondaishu
JS-Dev-101練習テスト問題、解答、解釈:https://drive.google.com/open?id=1UKEn_UTaskVIZ39NUNhLeZLgtKp07D27