最新的Salesforce Certified JavaScript Developer - Multiple Choice - JS-Dev-101免費考試真題
問題1
Given the code:
const copy = JSON.stringify([new String('false'), new Boolean(false), undefined]); What is the value of copy?
const copy = JSON.stringify([new String('false'), new Boolean(false), undefined]); What is the value of copy?
正確答案: C
說明:(僅 VCESoft 成員可見)
問題2
Which two implementations of utils.js support foo and bar?
正確答案: C,D
說明:(僅 VCESoft 成員可見)
問題3
A developer wants to use a module named universalContainerslib and then call functions from it. How should a developer import every function from the module and then call the functions foo and bar?
正確答案: B
說明:(僅 VCESoft 成員可見)
問題4
A developer has a fizzbuzz function that, when passed in a number, returns the following:
'fizz' if the number is divisible by 3.
'buzz' if the number is divisible by 5.
'fizzbuzz' if the number is divisible by both 3 and 5.
Empty string if the number is divisible by neither 3 nor 5.
Which two test cases properly test scenarios for the fizzbuzz function?
'fizz' if the number is divisible by 3.
'buzz' if the number is divisible by 5.
'fizzbuzz' if the number is divisible by both 3 and 5.
Empty string if the number is divisible by neither 3 nor 5.
Which two test cases properly test scenarios for the fizzbuzz function?
正確答案: A,D
說明:(僅 VCESoft 成員可見)
問題5
Which statement accurately describes an aspect of promises?
正確答案: A
說明:(僅 VCESoft 成員可見)
問題6
Refer to the code below:
flag();
function flag() {
console.log('flag');
}
const anotherFlag = () => {
console.log('another flag');
}
anotherFlag();
What is result of the code block?
flag();
function flag() {
console.log('flag');
}
const anotherFlag = () => {
console.log('another flag');
}
anotherFlag();
What is result of the code block?
正確答案: B
說明:(僅 VCESoft 成員可見)
問題7
A developer is creating a simple webpage with a button. When a user clicks this button for the first time, a message is displayed.
The developer wrote the JavaScript code below, but something is missing. The message gets displayed every time a user clicks the button, instead of just the first time.
01 function listen(event) {
02
03 alert('Hey! I am John Doe');
04
05 }
06 button.addEventListener('click', listen);
Which two code lines make this code work as required?
The developer wrote the JavaScript code below, but something is missing. The message gets displayed every time a user clicks the button, instead of just the first time.
01 function listen(event) {
02
03 alert('Hey! I am John Doe');
04
05 }
06 button.addEventListener('click', listen);
Which two code lines make this code work as required?
正確答案: B,D
說明:(僅 VCESoft 成員可見)
問題8
A class was written to represent regular items and sale items. Code:
01 let regItem = new Item('Scarf', 55);
02 let saleItem = new SaleItem('Shirt', 80, .1);
03 Item.prototype.description = function() { return 'This is a ' + this.name; }
04 console.log(regItem.description());
05 console.log(saleItem.description());
06
07 SaleItem.prototype.description = function() { return 'This is a discounted ' + this.name; }
08 console.log(regItem.description());
09 console.log(saleItem.description());
What is the output?
01 let regItem = new Item('Scarf', 55);
02 let saleItem = new SaleItem('Shirt', 80, .1);
03 Item.prototype.description = function() { return 'This is a ' + this.name; }
04 console.log(regItem.description());
05 console.log(saleItem.description());
06
07 SaleItem.prototype.description = function() { return 'This is a discounted ' + this.name; }
08 console.log(regItem.description());
09 console.log(saleItem.description());
What is the output?
正確答案: C
說明:(僅 VCESoft 成員可見)
問題9
Which three browser specific APIs are available for developers to persist data between page loads?
正確答案: B,D,E
說明:(僅 VCESoft 成員可見)

