Salesforce Certified JavaScript Developer - Multiple Choice - JS-Dev-101무료 덤프문제 풀어보기
A developer writes the code below to return a message to a user attempting to register a new username. If the username is available, a variable named msg is declared and assigned a value on line 03.
function getAvailabilityMessage(item) {
if (getAvailability(item)) {
var msg = "Username available";
return msg;
}
}
function getAvailabilityMessage(item) {
if (getAvailability(item)) {
var msg = "Username available";
return msg;
}
}
정답: C
설명: (Fast2test 회원만 볼 수 있음)
A developer wants to use a try...catch statement to catch any error that countSheep() may throw and pass it to a handleError() function.
What is the correct implementation of the try...catch?
What is the correct implementation of the try...catch?
정답: C
설명: (Fast2test 회원만 볼 수 있음)
Refer to the code below:
let strNumber = '12345';
Which code snippet shows a correct way to convert this string to an integer?
let strNumber = '12345';
Which code snippet shows a correct way to convert this string to an integer?
정답: C
설명: (Fast2test 회원만 볼 수 있음)
Considering type coercion, what does the following expression evaluate to?
true + '13' + NaN
true + '13' + NaN
정답: C
설명: (Fast2test 회원만 볼 수 있음)
Refer to the code below:
01 let country = {
02 get capital() {
03 let city = Number("London");
04
05 return {
06 cityString: city.toString(),
07 }
08 }
09 }
Which value can a developer expect when referencing country.capital.cityString?
01 let country = {
02 get capital() {
03 let city = Number("London");
04
05 return {
06 cityString: city.toString(),
07 }
08 }
09 }
Which value can a developer expect when referencing country.capital.cityString?
정답: D
설명: (Fast2test 회원만 볼 수 있음)
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. The test passes:
01 let res = sum3([1, 2, 3]);
02 console.assert(res === 6);
03
04 res = sum3([1, 2, 3, 4]);
05 console.assert(res === 6);
A different developer made changes to the behavior of sum3 to instead sum all of the numbers present in the array.
Which two results occur when running the test on the updated sum3 function?
01 let res = sum3([1, 2, 3]);
02 console.assert(res === 6);
03
04 res = sum3([1, 2, 3, 4]);
05 console.assert(res === 6);
A different developer made changes to the behavior of sum3 to instead sum all of the numbers present in the array.
Which two results occur when running the test on the updated sum3 function?
정답: B,C
설명: (Fast2test 회원만 볼 수 있음)