ExamGecko
Ask Question

Salesforce Certified JavaScript Developer I Practice Test - Questions Answers, Page 22

Add to Whishlist

List of questions

Question 211

Report Export Collapse

At Universal Containers, every team has its own way of copying JavaScript objects. The code snippet shows an Implementation from one team:

Salesforce Certified JavaScript Developer I image Question 211 63882 09232024002545000000

What is the output of the code execution?

Become a Premium Member for full access
  Unlock Premium Member

Question 212

Report Export Collapse

Refer to the code below

let inArray = [[1,2],[3,4,5]];

which two statements results in the array [1,2,3,4,5]?

choose 2 answer

Become a Premium Member for full access
  Unlock Premium Member

Question 213

Report Export Collapse

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 and Option B?

Become a Premium Member for full access
  Unlock Premium Member

Question 214

Report Export Collapse

Refer to the following code:

class Vehicle{

constructor(plate){

this.plate = plate;

}}

class Truck extends Vehicle{

constructor(plate, weight){

//Missing code

this.weight = weight;

}

displayWeight(){

console.log(`The truck ${this.plate} has a weight of ${this.weight}lb.`);

}}

let myTruck = new Truck('123Ab',5000);

myTruck.displayWeight();

Which statement should be added to missing code for the code to display 'The truck 123AB has a weight of 5000lb.

Become a Premium Member for full access
  Unlock Premium Member

Question 215

Report Export Collapse

Refer to the code below:

const car = {

price:100,

getPrice:function(){

return this.price;

}}

;

const customCar = Object.create(car);

customCar.price = 70;

delete customCar.price;const result = customCar.getPrice();

What is the value of result after the code executes?

Become a Premium Member for full access
  Unlock Premium Member

Question 216

Report Export Collapse

Refer to the code below:

Salesforce Certified JavaScript Developer I image Question 216 63887 09232024002545000000

What is the result when the Promise in the execute function is rejected?

Become a Premium Member for full access
  Unlock Premium Member

Question 217

Report Export Collapse

Given the JavaScript below:

Salesforce Certified JavaScript Developer I image Question 217 63888 09232024002545000000

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

Become a Premium Member for full access
  Unlock Premium Member

Question 218

Report Export Collapse

A developer tries to retrieve all cookies, then sets a certain key value pair in the cookie. These statements are used:

Salesforce Certified JavaScript Developer I image Question 218 63889 09232024002545000000

What is the behavior?

Become a Premium Member for full access
  Unlock Premium Member

Question 219

Report Export Collapse

Given the following code:

Salesforce Certified JavaScript Developer I image Question 219 63890 09232024002545000000

What is the output of line 02?

Become a Premium Member for full access
  Unlock Premium Member

Question 220

Report Export Collapse

A developer at Universal Containers is creating their new landing page based on HTML, CSS, and JavaScript.

To ensure that visitors have a good experience, a script named personalizeWebsiteContent needs to be executed when the webpage is fully loaded (HTML content and all related files), in order to do some custom initializations.

Which implementation should be used to call Fe:s:-a;::eHec5;te::.-.ter.: based on the business requirement above?

Become a Premium Member for full access
  Unlock Premium Member
Total 224 questions
Go to page: of 23
Search

Related questions