Free Certified JavaScript Developer I Exam Braindumps
Salesforce Certified JavaScript Developer I Questions 101–105 (page: 22)

Updated On: 10-Feb-2026

A developer is wondering whether to use, Promise.then or Promise.catch, especially when a Promise throws an error?
Which two promises are rejected?
Which 2 are correct?

  1. Promise.reject(`cool errorhere').then(error => console.error(error));
  2. Promise.reject(`cool error here').catch(error => console.error(error));
  3. New Promise((resolve, reject) => (throw `cool error here'}).catch(error =>console.error(error)) ;
  4. New Promise(() => (throw `cool error here'}).then(null, error => console.error(error)));

Answer(s): B,C



Refer to code below:
function Person() {
this.firstName = 'John';
}

Person.prototype ={
Job: x => `Developer'
};
const myFather = new Person();
const result=myFather.firstName + ` ` + myFather.job(); What is the value of the result after line 10 executes?

  1. Error: myFather.job is not a function
  2. Undefined Developer
  3. John undefined
  4. John Developer

Answer(s): A



Universal Containers (UC) notices that its application that allows users to search for accounts makes a network request each time a key is pressed. This results in too many requests for the server to handle.
Address this problem, UC decides to implement a debounce function on string change handler.
What are three key steps to implement this debounce function? Choose 3 answers:

  1. If there is an existing setTimeout and the search string change, allow the existingsetTimeout to finish, and do not enqueue a new setTimeout.
  2. When thesearch string changes, enqueue the request within a setTimeout.
  3. Ensure that the network request has the property debounce set to true.
  4. If there is an existing setTimeout and the search string changes, cancel the existingsetTimeout using thepersisted timerId and replace it with a new setTimeout.
  5. Store the timeId of the setTimeout last enqueued by the search string change handle.

Answer(s): A,B,C



Refer to the following object:
const cat ={
firstName: `Fancy',
lastName: ` Whiskers',
Get fullName() {
return this.firstName + ` ` + this.lastName;
}
};
How can a developer access the fullName property for cat?

  1. cat.fullName
  2. cat.fullName()
  3. cat.get.fullName
  4. cat.function.fullName()

Answer(s): A



Refer tofollowing 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 line 09 for the code to display `The truck 123AB has a weight of 5000lb.'?

  1. Super.plate =plate;
  2. super(plate);
  3. This.plate =plate;
  4. Vehicle.plate = plate;

Answer(s): B



Viewing page 22 of 46
Viewing questions 106 - 110 out of 224 questions


Post your Comments and Discuss Salesforce Certified JavaScript Developer I exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!