問題1
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?
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?
正確答案: A
說明:(僅 NewDumps 成員可見)
問題2
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 the server.
Will be imported with require, and made available with a variable called ws.
The developer also wants to add error logging if a connection fails.
Given this information, which code segment shows the correct way to set up a client with two events that listen at execution time?
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 the server.
Will be imported with require, and made available with a variable called ws.
The developer also wants to add error logging if a connection fails.
Given this information, which code segment shows the correct way to set up a client with two events that listen at execution time?
正確答案: D
說明:(僅 NewDumps 成員可見)
問題3
Refer to the code below:
01 let first = 'Who';
02 let second = 'What';
03 try {
04 try {
05 throw new Error('Sad trombone');
06 } catch (err) {
07 first = 'Why';
08 throw err;
09 } finally {
10 second = 'When';
11 }
12 } catch (err) {
13 second = 'Where';
14 }
What are the values for first and second once the code executes?
Refer to the code below:
01 let first = 'Who';
02 let second = 'What';
03 try {
04 try {
05 throw new Error('Sad trombone');
06 } catch (err) {
07 first = 'Why';
08 throw err;
09 } finally {
10 second = 'When';
11 }
12 } catch (err) {
13 second = 'Where';
14 }
What are the values for first and second once the code executes?
正確答案: D
說明:(僅 NewDumps 成員可見)
問題4
Refer to the following code block (with corrected template literals using backticks):
01 class Animal {
02 constructor(name) {
03 this.name = name;
04 }
05
06 makeSound() {
07 console.log(`${this.name} is making a sound.`);
08 }
09 }
10
11 class Dog extends Animal {
12 constructor(name) {
13 super(name);
14 this.name = name;
15 }
16 makeSound() {
17 console.log(`${this.name} is barking.`);
18 }
19 }
20
21 let myDog = new Dog('Puppy');
22 myDog.makeSound();
What is the console output?
Refer to the following code block (with corrected template literals using backticks):
01 class Animal {
02 constructor(name) {
03 this.name = name;
04 }
05
06 makeSound() {
07 console.log(`${this.name} is making a sound.`);
08 }
09 }
10
11 class Dog extends Animal {
12 constructor(name) {
13 super(name);
14 this.name = name;
15 }
16 makeSound() {
17 console.log(`${this.name} is barking.`);
18 }
19 }
20
21 let myDog = new Dog('Puppy');
22 myDog.makeSound();
What is the console output?
正確答案: C
說明:(僅 NewDumps 成員可見)
問題5
Refer to the code below:
01 const myFunction = arr => {
02 return arr.reduce((result, current) => {
03 return result + current;
04 }, 10);
05 }
What is the output of this function when called with an empty array?
Refer to the code below:
01 const myFunction = arr => {
02 return arr.reduce((result, current) => {
03 return result + current;
04 }, 10);
05 }
What is the output of this function when called with an empty array?
正確答案: A
說明:(僅 NewDumps 成員可見)
問題6
A developer is setting up a Node.js server and is creating a script at the root of the source code, index.js, that will start the server when executed. The developer declares a variable that needs the folder location that the code executes from.
Which global variable can be used in the script?
A developer is setting up a Node.js server and is creating a script at the root of the source code, index.js, that will start the server when executed. The developer declares a variable that needs the folder location that the code executes from.
Which global variable can be used in the script?
正確答案: A
說明:(僅 NewDumps 成員可見)
問題7
Given a value, which three options can a developer use to detect if the value is NaN?
Given a value, which three options can a developer use to detect if the value is NaN?
正確答案: B,C,D
說明:(僅 NewDumps 成員可見)
問題8
function myFunction() {
a = a + b;
var b = 1;
}
myFunction();
console.log(a);
console.log(b);
Which statement is correct?
function myFunction() {
a = a + b;
var b = 1;
}
myFunction();
console.log(a);
console.log(b);
Which statement is correct?
正確答案: B
說明:(僅 NewDumps 成員可見)
問題9
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 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?
正確答案: B
說明:(僅 NewDumps 成員可見)