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. Returns NaN
B. Throws an error
C. Returns 0
D. Returns 5 # (Text here appears to be a typo; correct value is 10, see explanation.)
正解:D
解説: (Pass4Test メンバーにのみ表示されます)
質問 2:
Refer to the following code:
01 class Ship {
02 constructor(size) {
03 this.size = size;
04 }
05 }
06
07 class FishingBoat extends Ship {
08 constructor(size, capacity){
09 //Missing code
10 this.capacity = capacity;
11 }
12 displayCapacity() {
13 console.log( ' The boat has a capacity of ${this.capacity} people. ' );
14 }
15 }
16
17 let myBoat = new FishingBoat( ' medium ' , 10);
18 myBoat.displayCapacity();
Which statement should be added to line 09 for the code to display
The boat has a capacity of 10 people?
A. ship.size = size;
B. super.size = size;
C. super(size);
D. this.size = size;
正解:C
解説: (Pass4Test メンバーにのみ表示されます)
質問 3:
Considering type coercion, what does the following expression evaluate to?
true + ' 13 ' + NaN
A. ' true13NaN '
B. 14
C. ' 113NaN '
D. ' true13 '
正解:A
解説: (Pass4Test メンバーにのみ表示されます)
質問 4:
Original code:
01 let requestPromise = client.getRequest;
03 requestPromise().then((response) = > {
04 handleResponse(response);
05 });
The developer wants to gracefully handle errors from a Promise-based GET request.
Which code modification is correct?
A. (duplicate of A)
B. Add .catch to the Promise chain
C. Use finally handler for errors
D. try/catch around requestPromise().then(...)
正解:B
解説: (Pass4Test メンバーにのみ表示されます)
質問 5:
Refer to the code below:
01 const addBy = ?
02 const addByEight = addBy(8);
03 const sum = addByEight(50);
Which two functions can replace line 01 and return 58 to sum?
A. (Corrected for typing errors)
const addBy = (num1) = > {
return function(num2) {
return num1 + num2;
}
}
B. const addBy = (num1) = > num1 + num2;
C. const addBy = function(num1) {
return num1 * num2;
}
D. const addBy = function(num1) {
return function(num2) {
return num1 + num2;
}
}
正解:A,D
解説: (Pass4Test メンバーにのみ表示されます)
質問 6:
Refer to the code below:
< html >
< body >
< div id= " logo " > Hello Logo! < /div >
< button id= " test " > Click me < /button >
< /body >
< script >
function printMessage(event) {
console.log( ' This is a test message ' );
}
let el = document.getElementById( ' test ' );
el.addEventListener( " click " , printMessage, false);
< /script >
< /html >
Which action should be done?
A. Add event.removeEventListener(); to printMessage function
B. Add event.stopPropagation(); to printMessage function
C. Add event.stopPropagation(); to window.onload event handler
D. Add event.removeEventListener(); to window.onload event handler
正解:B
解説: (Pass4Test メンバーにのみ表示されます)
質問 7:
Given the code below:
01 setCurrentUrl();
02 console.log( " The current URL is: " + url);
03
04 function setCurrentUrl() {
05 url = window.location.href;
06 }
What happens when the code executes?
A. The url variable has local scope and line 02 executes correctly.
B. The url variable has global scope and line 02 throws an error.
C. The url variable has local scope and line 02 throws an error.
D. The url variable has global scope and line 02 executes correctly.
正解:D
解説: (Pass4Test メンバーにのみ表示されます)
質問 8:
Given the code:
const copy = JSON.stringify([new String( ' false ' ), new Boolean(false), undefined]); What is the value of copy?
A. ' [ " false " , {}] '
B. ' [ " false " , false, null] '
C. ' [ " false " , false, undefined] '
D. ' [false, {}] '
正解:B
解説: (Pass4Test メンバーにのみ表示されます)
837 お客様のコメント
クリック」





星野** -
JavaScript-Developer-I問題集はとてもほうふで、なのにわかりやすかったです。今回の試験には受かる気がします。