Salesforce Certified JavaScript Developer - Multiple Choice - JS-Dev-101 模擬練習

A team at Universal Containers works on a big project and uses yarn to manage 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?

正解: A
解説: (PassTest メンバーにのみ表示されます)
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?

正解: D
解説: (PassTest メンバーにのみ表示されます)
01 function Monster() { this.name = 'hello'; };
02 const m = Monster();
What happens due to the missing new keyword?

正解: C
解説: (PassTest メンバーにのみ表示されます)
A developer needs to debug a Node.js web server because a runtime error keeps occurring at one of the endpoints.
The developer wants to test the endpoint on a local machine and make the request against a local server to look at the behavior. In the source code, the server.js file will start the server. The developer wants to debug the Node.js server only using the terminal.
Which command can the developer use to open the CLI debugger in their current terminal window?
(With corrected typing errors: node_inspect → node inspect, node_start_inspect → node start inspect.)

正解: C
解説: (PassTest メンバーにのみ表示されます)
Refer to the following code:
01 let obj = {
02 foo: 1,
03 bar: 2
04 }
05 let output = []
06
07 for (let something of obj) {
08 output.push(something);
09 }
10
11 console.log(output);
What is the value of output on line 11?

正解: B
解説: (PassTest メンバーにのみ表示されます)
Given the code below:
01 function Person(name, email) {
02 this.name = name;
03 this.email = email;
04 }
05
06 const john = new Person('John', '[email protected]');
07 const jane = new Person('Jane', '[email protected]');
08 const emily = new Person('Emily', '[email protected]');
09
10 let usersList = [john, jane, emily];
Which method can be used to provide a visual representation of the list of users and to allow sorting by the name or email attribute?

正解: D
解説: (PassTest メンバーにのみ表示されます)
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
解説: (PassTest メンバーにのみ表示されます)
Most accurate tests for:
const arr = Array(5).fill(0);

正解: A,C
解説: (PassTest メンバーにのみ表示されます)