Free Salesforce JavaScript-Developer-I Practice Test & Real Exam Questions

  • Exam Code/Number: JavaScript-Developer-I
  • Exam Name/Title: Salesforce Certified JavaScript Developer (JS-Dev-101)
  • Certification Provider: Salesforce
  • Corresponding Certification: Salesforce Developer
  • Exam Questions: 149
  • Updated On: Oct 08, 2026
A developer implements a function that adds a few values.
function sum(num1, num2, num3) {
if (num3 === undefined) {
num3 = 0;
}
return num1 + num2 + num3;
}
Which three options can the developer invoke for this function to get a return value of 10?
Correct Answer: A,B,D Vote an answer
Explanation: Only visible for Pass4Leader members. You can sign-up / login (it's free).
A developer is asked to fix some bugs reported by users. To do that, the developer adds a breakpoint for debugging.
01 function Car(maxSpeed, color) {
02 this.maxSpeed = maxSpeed;
03 this.color = color;
04 }
05 let carSpeed = document.getElementById( ' carSpeed ' );
06 debugger;
07 let fourWheels = new Car(carSpeed.value, ' red ' );
When the code execution stops at the breakpoint on line 06, which two types of information are available in the browser console?
Correct Answer: A,B Vote an answer
Explanation: Only visible for Pass4Leader members. You can sign-up / login (it's free).
HTML:
< p > The current status of an Order: < span id= " status " > In Progress < /span > < /p > Which JavaScript statement changes ' In Progress ' to ' Completed ' ?
Correct Answer: B Vote an answer
Explanation: Only visible for Pass4Leader members. You can sign-up / login (it's free).
01 function Animal(size, type) {
02 this.type = type || ' Animal ' ;
03 this.canTalk = false;
04 }
05
06 Animal.prototype.speak = function() {
07 if (this.canTalk) {
08 console.log( " It spoke! " );
09 }
10 };
11
12 let Pet = function(size, type, name, owner) {
13 Animal.call(this, size, type);
14 this.size = size;
15 this.name = name;
16 this.owner = owner;
17 }
18
19 Pet.prototype = Object.create(Animal.prototype);
20 let pet1 = new Pet();
Given the code above, which three properties are set for pet1?
Correct Answer: A,B,D Vote an answer
Explanation: Only visible for Pass4Leader members. You can sign-up / login (it's free).
Refer to the code snippet:
01 function getAvailableilityMessage(item) {
02 if (getAvailableility(item)) {
03 var msg = " Username available " ;
04 }
05 return msg;
06 }
What is the return value of msg when getAvailableilityMessage( " newUserName " ) is executed and getAvailableility( " newUserName " ) returns false?
Correct Answer: C Vote an answer
Explanation: Only visible for Pass4Leader members. You can sign-up / login (it's free).
Refer to the code:
01 function execute() {
02 return new Promise((resolve, reject) = > reject());
03 }
04 let promise = execute();
05
06 promise
07 .then(() = > console.log( ' Resolved1 ' ))
08 .then(() = > console.log( ' Resolved2 ' ))
09 .then(() = > console.log( ' Resolved3 ' ))
10 .catch(() = > console.log( ' Rejected ' ))
11 .then(() = > console.log( ' Resolved4 ' ));
What is the result when the Promise in the execute function is rejected?
Correct Answer: B Vote an answer
Explanation: Only visible for Pass4Leader members. You can sign-up / login (it's free).
Refer to the following code:
01 class Ship {
02 constructor(size) {
03 this.size = size;
04 }
05 }
06
07 class FishingBoat extends Ship {
08 constructor(size, capacity){
09 //Missing code
10 this.capacity = capacity;
11 }
12 displayCapacity() {
13 console.log( ' The boat has a capacity of ${this.capacity} people. ' );
14 }
15 }
16
17 let myBoat = new FishingBoat( ' medium ' , 10);
18 myBoat.displayCapacity();
Which statement should be added to line 09 for the code to display
The boat has a capacity of 10 people?
Correct Answer: C Vote an answer
Explanation: Only visible for Pass4Leader members. You can sign-up / login (it's free).
Refer to the following code block (with corrected template literals using backticks):
01 class Animal {
02 constructor(name) {
03 this.name = name;
04 }
05
06 makeSound() {
07 console.log(`${this.name} is making a sound.`);
08 }
09 }
10
11 class Dog extends Animal {
12 constructor(name) {
13 super(name);
14 this.name = name;
15 }
16 makeSound() {
17 console.log(`${this.name} is barking.`);
18 }
19 }
20
21 let myDog = new Dog( ' Puppy ' );
22 myDog.makeSound();
What is the console output?
Correct Answer: B Vote an answer
Explanation: Only visible for Pass4Leader members. You can sign-up / login (it's free).