Last Updated On : 29-Jun-2026


Salesforce Certified JavaScript Developer - JS-Dev-101 Practice Test

Prepare with our free Salesforce Certified JavaScript Developer - JS-Dev-101 sample questions and pass with confidence. Our Salesforce-JavaScript-Developer practice test is designed to help you succeed on exam day.

271 Questions
Salesforce 2026

Console logging methods that allow string substitution:

A. message

B. log

C. assert

D. info

E. error

B.   log
C.   assert
D.   info
E.   error

A developer wants to catch any error that countSheep() may throw and pass it to handleError().

Which implementation is correct?

A. try {
> setTimeout(function() {
> countSheep();
> }, 1000);
> }
> catch (e) {
> handleError(e);
> }

B. try {
countSheep();
} finally {
handleError(e);
}

C. try {
countSheep();
} handleError(e) {
catch(e);
}

D. setTimeout(function() {
try {

A.   try {
> setTimeout(function() {
> countSheep();
> }, 1000);
> }
> catch (e) {
> handleError(e);
> }

Which statement accurately describes the behavior of the async/await keywords?

A. The associated function sometimes returns a promise.

B. The associated function can only be called via asynchronous methods.

C. The associated class contains some asynchronous functions.

D. The associated function is asynchronous, but acts like synchronous code.

D.   The associated function is asynchronous, but acts like synchronous code.

Given the code below:

01 const delay = async delay = > {

02 return new Promise((resolve, reject) = > {

03 console.log(1);

04 setTimeout(resolve, delay);

05 });

06 };

07

08 const callDelay = async () = > {

09 console.log(2);

10 const yup = await delay(1000);

11 console.log(3);

12 };

13

14 console.log(4);

15 callDelay();

16 console.log(5);

What is logged to the console?

A. 4 2 1 5 3

B. 4 2 1 5 3

C. 1 4 2 3 5

D. 4 5 1 2 3

A.   4 2 1 5 3

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?

A. super(size);

B. ship.size = size;

C. super.size = size;

D. this.size = size;

A.   super(size);

Page 1 out of 55 Pages