更新されたのは2026年08月は100%カバー率でJS-Dev-101リアルな試験問題で100%合格保証
実際問題を使おうSalesforce問題集で100%無料で使えるJS-Dev-101試験問題集
Salesforce JS-Dev-101 認定試験の出題範囲:
| トピック | 出題範囲 |
|---|---|
| トピック 1 |
|
| トピック 2 |
|
| トピック 3 |
|
質問 # 27
const str = 'Salesforce';
Which two statements result in the word "Sales"?
- A. str.substring(0, 5);
- B. str.substring(0, 5);
- C. str.substr(0, 5);
- D. str.substr(s, 5);
正解:A、C
解説:
Comprehensive and Detailed
"Salesforce" indices: S(0) a(1) l(2) e(3) s(4) f(5) ...
A / C (substring(0, 5)):
substring(start, end) returns characters from start up to but not including end.
str.substring(0, 5) → characters at indices 0,1,2,3,4 → "Sales".
D (substr(0, 5)):
substr(start, length) returns length characters starting at start.
str.substr(0, 5) → 5 chars from index 0 → "Sales".
B is invalid because s is not defined; it should be 0. So the two correct statements are A and D.
質問 # 28
Refer to the following code:
What is the output of line 11?
- A. ["foo:1", "bar:2"]
- B. ["bar", "foo"]
- C. ["foo", "bar"]
- D. [1,2]
正解:C
質問 # 29
Which statement accurately describes an aspect of promises?
- A. .then() cannot be added after a catch.
- B. Arguments for the callback function passed to .then() are optional.
- C. In a .then() function, returning results is not necessary since callbacks will catch the result of a previous promise.
- D. .then() manipulates and returns the original promise.
正解:B
解説:
________________________________________
Comprehensive and Detailed Explanation From Exact Extract JavaScript Knowledge Evaluate each option:
________________________________________
A . Arguments for .then() are optional.
This is correct.
.then() has the signature:
promise.then(onFulfilled?, onRejected?)
Both arguments (onFulfilled and onRejected) are optional.
If a callback is not supplied, JavaScript provides a default pass-through handler.
________________________________________
B . .then() cannot be added after a catch.
Incorrect.
Promises support chaining in any order:
promise
.catch(...)
.then(...);
After a catch, the chain continues normally.
________________________________________
C . .then() manipulates and returns the original promise.
Incorrect.
.then() always returns a new promise, not the original one.
This is fundamental to promise chaining behavior.
________________________________________
D . Returning values in .then() is not necessary.
Incorrect.
If you want the next .then() in the chain to receive a value, the current .then() must explicitly return it:
.then(value => {
return value * 2; // passes to next .then()
})
If nothing is returned, the next .then() receives undefined.
________________________________________
Why A is correct
It is the only statement that accurately describes built-in Promise behavior:
.then() accepts optional arguments.
________________________________________
JavaScript Knowledge Reference (text-only)
.then(onFulfilled?, onRejected?) accepts optional handlers.
Promise chaining creates new promises for each .then().
catch() can be followed by additional .then() calls.
Returning inside .then() passes values to the next step in the chain.
質問 # 30
01 function changeValue(obj) {
02 obj.value = obj.value / 2;
03 }
04 const objA = { value: 10 };
05 const objB = objA;
06
07 changeValue(objB);
08 const result = objA.value;
What is the value of result?
- A. NaN
- B. 0
- C. undefined
- D. 1
正解:B
解説:
________________________________________
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.
質問 # 31
01 function Animal(size, type) {
02 this.type = type || 'Animal';
03 this.canTalk = false;
04 }
05
06 Animal.prototype.speak = function() {
07 if (this.canTalk) {
08 console.log("It spoke!");
09 }
10 };
11
12 let Pet = function(size, type, name, owner) {
13 Animal.call(this, size, type);
14 this.size = size;
15 this.name = name;
16 this.owner = owner;
17 }
18
19 Pet.prototype = Object.create(Animal.prototype);
20 let pet1 = new Pet();
Given the code above, which three properties are set for pet1?
- A. canTalk
- B. owner
- C. name
- D. type
- E. speak
正解:A、C、D
解説:
When pet1 = new Pet(); is created:
Inside Pet constructor:
Animal.call(this, size, type);
this.size = size;
this.name = name;
this.owner = owner;
Animal.call(this, size, type):
Sets this.type = type || 'Animal' → 'Animal' (because type is undefined).
Sets this.canTalk = false.
Then this.size, this.name, this.owner are set (to undefined since no args passed), but they do exist as properties.
So as own properties, pet1 has: type, canTalk, size, name, owner.
speak is defined on Animal.prototype, so pet1.speak exists by inheritance, but is not an own data property created in the constructor.
From the listed options, three important properties directly set by constructor logic and clearly used in behavior are:
canTalk
name
type
Thus, C, D, E.
________________________________________
質問 # 32
Referto the following code:
Which two statement could be inserted at line 17 to enable the function call on line 18? Choose 2 answers
- A. leo.prototype.roar = ( ) =>( console.log('They\'re pretty good!'); };
- B. leo.roar = () => { console.log('They\'re pretty good!'); );
- C. Object.assign (leo, tony);
- D. Object.assign (leo. Tiger);
正解:B、C
質問 # 33
A developer is setting up a new Node.js server with a client library that is built using events and callbacks.
The library:
* Will establish a web socket connection and handle receipt of messages to theserver
* Will be imported with require, and made available with a variable called we.
The developer also wants to add error logging if a connection fails.
Given this info, which code segment shows the correct way to set up a client with two events that listen at execution time?
- A. try{ws.connect (( ) => {console.log('connected to client'); });} catch(error) { console.log('ERROR' ,error); };}
- B. ws.connect (( ) => {console.log('connected to client'); }).catch((error) => { console.log('ERROR' , error); }};
- C. ws.on ('connect', ( ) => {console.log('connected to client'); ws.on('error', (error) => { console.log('ERROR' ,error); });}); C. ws.on ('connect', ( ) => { console.log('connected to client'); }}; ws.on('error', (error) => { console.log('ERROR' , error); }};
正解:A
質問 # 34
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.
Const sumFunction = arr => {
Return arr.reduce((result, current) => {
//
Result += current;
//
), 10);
);
Which option makes the code work as expected?
- A. Replace line 03 with if(arr.length == 0 ) ( return 0; )
- B. Replace line02 with return arr.map(( result, current) => (
- C. Replace line 04 with result = result +current;
- D. Replace line 05 with return result;
正解:D
質問 # 35
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.2.3
- B. 1.2.0
- C. 1.1.4
- D. 2.0.0
正解:B
質問 # 36
bar, awesome is a popular JavaScript module. the versions publish to npm are:
Teams at Universal Containers use this module in a number of projects. A particular project has thepackage, json definition below.
A developer runs this command: npm install. Which version of bar .awesome is installed?
- A. The command fails, because version 130 is not found
- B. 1.4.0
- C. 1.3.5
- D. 1.3.1
正解:C
質問 # 37
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.on('error', (error) => {
console.log('ERROR', error);
}); - B. server.catch('error) => {
console.log('ERROR', error);
}); - C. server.error('error) => {
console.log('ERROR', error);
}); - D. try {
server.start();
} catch(error) {
正解:A
解説:
console.log('ERROR', error);
}
Explanation:
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.
質問 # 38
Which statement allows a developer to update the browser navigation history without a page refresh?
- A. window.customHistory.pushState(newStateObject, '', null);
- B. window.history.createState(newStateObject, '');
- C. window.history.pushState(newStateObject, '', null);
- D. window.history.updateState(newStateObject, '');
正解:A
質問 # 39
Refer to the code below (assuming Promise.race is intended):
let cat3 = new Promise(resolve =>
setTimeout(resolve, 3000, "Cat 3 completes")
);
Promise.race([cat1, cat2, cat3])
.then(value => {
let result = `${value} the race.`;
})
.catch(err => {
console.log("Race is cancelled:", err);
});
(Assuming cat1 and cat2 are similar to earlier examples: cat2 resolves fastest.) What is the value of result when Promise.race executes?
- A. Car 2 completed the race.
- B. Car 1 crashed on the race.
- C. Race is cancelled.
- D. Car 3 completed the race.
正解:A
解説:
From earlier pattern (cars/cats race):
One promise resolves the fastest with "Car 2 completed" (or analogous "Cat 2 completes").
Promise.race resolves with the first settled promise's value.
In .then, value is "Car 2 completed" and:
let result = `${value} the race.`;
// "Car 2 completed the race."
Thus result is "Car 2 completed the race." → option A.
質問 # 40
A developer wants to advocate for a mature, well-supported web framework/library instead of a new one (Minimalist.js).
Which two should be recommended?
- A. Vue
- B. Express
- C. Koa
- D. React
正解:A、D
解説:
________________________________________
Comprehensive and Detailed Explanation From Exact Extract JavaScript Knowledge React and Vue are:
Mature front-end JavaScript frameworks/libraries.
Have large communities.
Are widely supported and used in production across industries.
Appropriate for building browser-based Single Page Applications.
Express and Koa are server-side frameworks, not front-end SPA frameworks.
The scenario describes building a browser SPA, so the correct seasoned options are React and Vue.
________________________________________
JavaScript Knowledge Reference (text-only)
React and Vue are client-side frameworks for SPA development.
Express and Koa are backend frameworks for Node.js.
質問 # 41
Refer to the code below:
01 new Promise((resolve, reject) => {
02 const fraction = Math.random();
03 if (fraction > 0.5) reject('fraction > 0.5, ' + fraction);
04 resolve(fraction);
05 })
06 .then(() => console.log('resolved'))
07 .catch((error) => console.error(error))
08 .finally(() => console.log('when am I called?'));
When does Promise.finally on line 08 get called?
- A. When rejected
- B. When resolved and settled
- C. When resolved
- D. When resolved or rejected
正解:D
解説:
Comprehensive and Detailed Explanation From Exact Extract JavaScript knowledge:
Behavior of Promise.prototype.finally:
.finally(handler) registers a callback that runs when the promise is settled, meaning:
Either fulfilled (resolved), or
rejected.
Important points:
The finally callback does not receive the promise's value or error (unlike then and catch).
It is executed after the promise is settled, but before the resolution value or rejection reason is passed further down the chain.
It runs in both success and failure paths.
In the given code:
The promise may either:
Call reject('fraction > 0.5, ' + fraction) if fraction > 0.5, or
Call resolve(fraction) otherwise.
In both cases:
If it resolves, .then(() => console.log('resolved')) runs, and then .finally(...) is executed.
If it rejects, .catch((error) => console.error(error)) runs, and then .finally(...) is executed.
So .finally runs:
Not just "when rejected".
Not just "when resolved".
But whenever the promise is resolved or rejected.
Therefore, the correct choice is:
D . When resolved or rejected.
質問 # 42
Cloud Kicks has a class to represent items for sale in an online store, as shown below:
Class Item{
constructor (name, price){
this.name = name;
this.price = price;
}
formattedPrice(){
return 's' + String(this.price);}}
A new business requirement comes in that requests a ClothingItem class that should have all of the properties and methods of the Item class but will also have properties that are specific to clothes.
Which line of code properly declares the clothingItem class such that it inherits from Item?
- A. Class ClothingItem super Item {
- B. Class ClothingItem {
- C. Class ClothingItem extends Item {
- D. Class ClothingItem implements Item{
正解:C
質問 # 43
Given the expressionsvar1 and var2, what are two valid ways to return the concatenation of the two expressions and ensure it is string? Choose 2 answers
- A. String (var1) .concat (var2)
- B. string.concat (var1 +var2)
- C. var1.toString ( ) var2.toString ( )
- D. var1 + var2
正解:B、C
質問 # 44
......
JS-Dev-101問題集PDFでJS-Dev-101リアル試験問題解答:https://www.goshiken.com/Salesforce/JS-Dev-101-mondaishu.html
実際に出るJS-Dev-101最新の問題集練習テスト問題集:https://drive.google.com/open?id=1I3qJQrLfDPugrkDWP_4kE1d4T7YH7o_5