JavaScript-Developer-I試験無料問題集「Salesforce Certified JavaScript Developer I 認定」

Given the JavaScript below:

Which code should replace the placeholder comment on line 06 to hide accounts that do not match the search string?

Refer to code below:
Let first = 'who';
Let second = 'what';
Try{
Try{
Throw new error('Sad trombone');
}catch (err){
First ='Why';
}finally {
Second ='when';
} catch (err) {
Second ='Where';
}
What are the values for first and second once the code executes ?

A developer has two ways to write a function:
Option A:
function Monster() {
This.growl = () => {
Console.log ("Grr!");
}
}
Option B:
function Monster() {};
Monster.prototype.growl =() => {
console.log("Grr!");
}
After deciding on an option, the developer creates 1000 monster objects.
How many growl methods are created with Option A Option B?

Teams at Universal Containers (UC) work on multiple JavaScript projects at the same time.
UC is thinking about reusability and how each team can benefit from the work of others.
Going open-source or public is not an option at this time.
Which option is available to UC with npm?

Refer to the following code block:
class Animal{
constructor(name){
this.name = name;
}
makeSound(){
console.log(`${this.name} ismaking a sound.`)
}
}
class Dog extends Animal{
constructor(name){
super(name)
this.name = name;
}
makeSound(){
console.log(`${this.name} is barking.`)
}
}
let myDog = new Dog('Puppy');
myDog.makeSound();
What is the console output?
正解:
Puppy is barking
Refer to code below:
Const objBook = {
Title: 'Javascript',
};
Object.preventExtensions(objBook);
Const newObjBook = objBook;
newObjectBook.author ='Robert';
What are the values of objBook and newObjBook respectively ?

Refer to the HTML below:
<div id="main">
<ul>
<li>Leo</li>
<li>Tony</li>
<li>Tiger</li>
</ul>
</div>
Which JavaScript statement results in changing " Tony" to "Mr. T."?

A developer at Universal Containers is creating their new landing pagebased on HTML, CSS, and JavaScript.
The website includes multiple external resources that are loaded when the page is opened.
To ensure that visitors have a good experience, a script named personalizeWebsiteContent needs to be executed when the webpage isloaded and there is no need to wait for the resources to be available.
Which statement should be used to call personalizeWebsiteContent based on the above business requirement?

Consider type coercion, what does the following expression evaluate to?
True + 3 + '100' + null

Considering type coercion, what does the following expression evaluate to?
True + '13' + NaN

Refer to the following code block:

What is the console output?

Refer to the code below:
Function changeValue(obj) {
Obj.value = obj.value/2;
}
Const objA = (value: 10);
Const objB = objA;
changeValue(objB);
Const result = objA.value;
What is the value of result after the code executes?

Refer to the string below:
const str = 'Salesforce';
Which two statements result in the word 'Sales'?
Choose 2 answers

A class was written to represent items for purchase in an online store, and a secondclass Representing items that are on sale at a discounted price. THe constructor sets the name to the first value passed in. The pseudocode is below:
Class Item {
constructor(name, price) {
... // Constructor Implementation
}
}
Class SaleItem extends Item {
constructor (name, price, discount) {
...//Constructor Implementation
}
}
There is a new requirement for a developer to implement a description method that will return a brief description for Item and SaleItem.
Let regItem =new Item('Scarf', 55);
Let saleItem = new SaleItem('Shirt' 80, -1);
Item.prototype.description = function () { return 'This is a ' + this.name; console.log(regItem.description()); console.log(saleItem.description()); SaleItem.prototype.description = function () { return 'This is a discounted ' + this.name; } console.log(regItem.description()); console.log(saleItem.description()); What is the output when executing the code above ?

In the browser, the window object is often used to assign variables that require the broadest scope in an application Node.js application does not have access to the window object by default.
Which two methods areused to address this ?
Choose 2 answers