Refer to the code below:
Const pi = 3.1415326,
What is the data type of pi?
A. Number
B. Float
C. Double
D. Decimal
正解:A
質問 2:
Refer to the code below:
let o = {
get js() {
let city1 = String("st. Louis");
let city2 = String(" New York");
return {
firstCity: city1.toLowerCase(),
secondCity: city2.toLowerCase(),
}
}
}
What value can a developer expect when referencing o.js.secondCity?
A. ' New York '
B. An error
C. ' new york '
D. Undefined
正解:C
質問 3:
A developer creates a generic function to log custom messages in the console. To do this, the function below is implemented.
01 function logStatus(status){
02 console./*Answer goes here*/{'Item status is: %s', status};
03 }
Which three console logging methods allow the use of string substitution in line 02?
A. Error
B. Info
C. Assert
D. Log
E. Message
正解:A,B,D
質問 4:
Refer to the code below:
for(let number =2 ; number <= 5 ; number += 1 ) {
// insert code statement here
}
The developer needs to insert a code statement in the location shown. The code statement has these requirements:
1. Does require an import
2. Logs an error when the boolean statement evaluates to false
3. Works in both the browser and Node.js
Which meet the requirements?
A. console.debug(number % 2 === 0);
B. assert (number % 2 === 0);
C. console.error(number % 2 === 0);
D. console.assert(number % 2 === 0);
正解:C
質問 5:
Refer to the string below:
const str = 'Salesforce';
Which two statements result in the word 'Sales'?
Choose 2 answers
A. str.substr (0, 5);
B. str.substr(1, 5);
C. str.substring (1, 5);
D. str.substring (0, 5);
正解:A,D
質問 6:
A developer wrote the following code to test a sum3 function that takes in an array of numbers and returns the sum of the first three numbers in the array, and the test passes.
A different developer made changes to the behavior of sum3 to instead sum only the first two numbers present in the array.
Which two results occur when running this test on the updated sum3 function?
Choose 2 answers
A. The line 05 assertion fails.
B. The line 02 assertion fails.
C. The line 05 assertion passes.
D. The line 02 assertion passes.
正解:A,D
質問 7:
Refer to the code below:
01 const server = require('server');
02 /* Insert code here */
A developer imports a library that creates a web server. The imported 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. Server.start ();
C. serve(( port) => (
D. console.log( 'Listening on ', port) ;
E. server()
正解:A
質問 8:
Refer to the following object.
How can a developer access the fullName property for dog?
A. Dog.fullName ( )
B. Dog.fullName
C. Dog, function, fullName
D. Dog, get, fullName
正解:B
質問 9:
A developer receives a comment from the Tech Lead that the code given below has error:
const monthName = 'July';
const year = 2019;
if(year === 2019) {
monthName = 'June';
}
Which line edit should be made to make this code run?
A. 01 let monthName ='July';
B. 03 if (year == 2019) {
C. 02 const year = 2020;
D. 02 let year =2019;
正解:A
Maruyama -
知識は勉強してからチャレンジもあります
忘れように勉強しました
Pass4Testの問題集は他の本より安い上にしっかり知識を身に着けられるから安心