Spring Sale Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: buysanta

Exact2Pass Menu

Salesforce Certified JavaScript Developer (JS-Dev-101)

Last Update 3 hours ago Total Questions : 147

The Salesforce Certified JavaScript Developer (JS-Dev-101) content is now fully updated, with all current exam questions added 3 hours ago. Deciding to include JavaScript-Developer-I practice exam questions in your study plan goes far beyond basic test preparation.

You'll find that our JavaScript-Developer-I exam questions frequently feature detailed scenarios and practical problem-solving exercises that directly mirror industry challenges. Engaging with these JavaScript-Developer-I sample sets allows you to effectively manage your time and pace yourself, giving you the ability to finish any Salesforce Certified JavaScript Developer (JS-Dev-101) practice test comfortably within the allotted time.

Question # 1

Refer to the code:

01 let car1 = new Promise((_, reject) = >

02 setTimeout(reject, 2000, " Car 1 crashed in " ));

03 let car2 = new Promise(resolve = >

04 setTimeout(resolve, 1500, " Car 2 completed " ));

05 let car3 = new Promise(resolve = >

06 setTimeout(resolve, 3000, " Car 3 completed " ));

07

08 Promise.race([car1, car2, car3])

09 .then(value = > {

10 let result = ' $(value) the race. ' ;

11 })

12 .catch(err = > {

13 console.log( " Race is cancelled. " , err);

14 });

What is the value of result when Promise.race executes?

A.

Car 2 completed the race.

B.

Car 3 completed the race.

C.

Race is cancelled.

D.

Car 1 crashed in the race.

Question # 2

A developer has an isDeg function that takes one argument, pts. They want to schedule the function to run every minute.

What is the correct syntax for scheduling this function?

A.

setInterval(isDeg( ' cat ' ), 60000);

B.

setInterval(isDeg, 60000, ' cat ' );

C.

setTimeout(isDeg, 60000, ' cat ' );

D.

setTimeout(isDeg( ' cat ' ), 60000);

Question # 3

A team at Universal Containers works on a big project and uses Yarn to deal with the project’s dependencies. A developer added a dependency to manipulate dates and pushed the updates to the remote repository. The rest of the team complains that the dependency does not get downloaded when they execute yarn.

What could be the reason for this?

A.

The developer missed the option --add when adding the dependency.

B.

The developer added the dependency as a dev dependency, and NODE_ENV is set to production.

C.

The developer added the dependency as a dev dependency, and YARN_ENV is set to production.

D.

The developer missed the option --save when adding the dependency.

Question # 4

Refer to the code below:

let strNumber = ' 12345 ' ;

Which code snippet shows a correct way to convert this string to an integer?

A.

let numberValue = Integer(strNumber);

B.

let numberValue = textValue.toInteger();

C.

let numberValue = Number(strNumber);

D.

let numberValue = (number) textValue;

Question # 5

Given the following code:

01 counter = 0;

02 const logCounter = () = > {

03 console.log(counter);

04 };

05 logCounter();

06 setTimeout(logCounter, 2100);

07 setInterval(() = > {

08 counter++;

09 logCounter();

10 }, 1000);

What will be the first four numbers logged?

A.

0122

B.

0123

C.

0112

D.

0012

Question # 6

Refer to the code below:

01 let first = ' Who ' ;

02 let second = ' What ' ;

03 try {

04 try {

05 throw new Error( ' Sad trombone ' );

06 } catch (err) {

07 first = ' Why ' ;

08 throw err;

09 } finally {

10 second = ' When ' ;

11 }

12 } catch (err) {

13 second = ' Where ' ;

14 }

What are the values for first and second once the code executes?

A.

first is Who and second is Where.

B.

first is Why and second is Where.

C.

first is Who and second is When.

D.

first is Why and second is When.

Question # 7

Which two code snippets show working examples of a recursive function?

A.

const sumToTen = numVar = > {

if (numVar < 0)

return;

return sumToTen(numVar + 1);

};

B.

function factorial(numVar) {

if (numVar < 0) return;

if (numVar === 0) return 1;

return numVar - 1;

}

C.

const factorial = numVar = > {

if (numVar < 0) return;

if (numVar === 0) return 1;

return numVar * factorial(numVar - 1);

};

D.

let countingDown = function(startNumber) {

if (startNumber > 0) {

console.log(startNumber);

return countingDown(startNumber - 1);

} else {

return startNumber;

}

};

(Note: Option D is shown here with corrected syntax: lowercase return and matching parentheses.)

Question # 8

Refer to the code snippet:

01 let array = [1, 2, 3, 4, 4, 5, 4, 4];

02 for (let i = 0; i < array.length; i++) {

03 if (array[i] === 4) {

04 array.splice(i, 1);

05 i--;

06 }

07 }

What is the value of array after the code executes?

A.

[1, 2, 3, 4, 5, 4, 4]

B.

[1, 2, 3, 4, 4, 5, 4]

C.

[1, 2, 3, 4, 5, 4]

D.

[1, 2, 3, 5]

Question # 9

Given the following code:

let x = ( ' 15 ' + 10) * 2;

What is the value of x?

A.

1520

B.

3020

C.

50

D.

35

Question # 10

What are two unique features of fat-arrow functions compared to normal function definitions?

A.

If the function has a single expression in the function body, the expression will be evaluated and implicitly returned.

B.

The function uses the this from the enclosing scope.

C.

The function receives an argument called parentThis, giving the enclosing lexical scope.

D.

The function generates its own this making it useful for separating scope.

Go to page: