Winter Sale Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: s2p65

Easiest Solution 2 Pass Your Certification Exams

JavaScript-Developer-I Salesforce Certified JavaScript Developer (JS-Dev-101) Free Practice Exam Questions (2025 Updated)

Prepare effectively for your Salesforce JavaScript-Developer-I Salesforce Certified JavaScript Developer (JS-Dev-101) certification with our extensive collection of free, high-quality practice questions. Each question is designed to mirror the actual exam format and objectives, complete with comprehensive answers and detailed explanations. Our materials are regularly updated for 2025, ensuring you have the most current resources to build confidence and succeed on your first attempt.

Page: 3 / 4
Total 219 questions

Refer to code below:

console.log(0);

setTimeout(() => (

console.log(1);

});

console.log(2);

setTimeout(() => {

console.log(3);

), 0);

console.log(4);

In which sequence will the numbers be logged?

A.

01234

B.

02431

C.

02413

D.

13024

developer publishes a new version of a package with new features that do not break

backward compatibility. The previous version number was 1.1.3.

Following semantic versioning format, what should the new package version number

be?

A.

2.0.0

B.

1.2.3

C.

1.1.4

D.

1.2.0

A developer needs to debug a Node.js web server because a runtime error keeps occurring at one of the endpoints.

The developer wants to test the endpoint on a local machine and make the request against a local server to look at the behavior. In the source code, the server, js file will start the server. the developer wants to debug the Node.js server only using the terminal.

Which command can the developer use to open the CLI debugger in their current terminal window?

A.

node -i server.js

B.

node inspect server,js

C.

node server,js inspect

D.

node start inspect server,js

Which code change should be done for the console to log the following when 'Click me!' is clicked'

> Row log

> Table log

A.

Remove lines 13 and14

B.

Change line 10 to event.stopPropagation (false) ;

C.

Change line 14 to elem.addEventListener ('click', printMessage, true);

D.

Remove line 10

At Universal Containers, every team has its own way of copying JavaScript objects. The

code

Snippet shows an implementation from one team:

Function Person() {

this.firstName = “John”;

this.lastName = ‘Doe’;

This.name =() => (

console.log(‘Hello $(this.firstName) $(this.firstName)’);

)}

Const john = new Person ();

Const dan =JSON.parse(JSON.stringify(john));

dan.firstName =’Dan’;

dan.name();

What is the Output of the code execution?

A.

Hello Dan Doe

B.

Hello John DOe

C.

TypeError: dan.name is not a function

D.

TypeError: Assignment to constant variable.

Which code statement below correctly persists an objects inlocal Storage ?

A.

const setLocalStorage = (storageKey, jsObject) => {window.localStorage.setItem(storageKey, JSON.stringify(jsObject));}

B.

const setLocalStorage = ( jsObject) => {window.localStorage.connectObject(jsObject));}

C.

const setLocalStorage= ( jsObject) => {window.localStorage.setItem(jsObject);}

D.

const setLocalStorage = (storageKey, jsObject) => {window.localStorage.persist(storageKey, jsObject);}

Universal Containers recently launched its new landing page to host a crowd-funding

campaign. The page uses an external library to display some third-party ads. Once the page is

fully loaded, it creates more than 50 new HTML items placed randomly insidethe DOM, like the

one in the code below:

All the elements includes the same ad-library-item class, They are hidden by default, and they are randomly displayed while the user navigates through the page.

A.

Use the DOM inspector to prevent the load eventto be fired.

B.

Use the browser to execute a script that removes all the element containing the class ad-library-item.

C.

Use the DOM inspector to remove all the elements containing the class ad-library-item.

D.

Use the browser console to execute a scriptthat prevents the load event to be fired.

Given the JavaScript below:

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

A.

‘None’ : ‘block’

B.

‘Visible : ’hidden’

C.

‘Hidden, visible

D.

‘Block’ : ‘none’

Refer to code below:

Const objBook = {

Title: ‘Javascript’,

};

Object.preventExtensions(objBook);

Const newObjBook = objBook;

newObjectBook.author =‘Robert’;

What are the values of objBook and newObjBook respectively ?

A.

[title: “javaScript”] [title: “javaScript”]

B.

{author: “Robert”, title: “javaScript}Undefined

C.

{author: “Robert”, title: “javaScript}{author: “Robert”, title: “javaScript}

D.

{author: “Robert”}{author: “Robert”, title: “javaScript}

Given the HTML below:

Which statement adds the priority-account css class to the Applied Shipping row?

A.

document.querySelector('#row-as').classList.add('priority-account');

Refer to the code below:

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

Which two statements result in the array [1, 2, 3, 4, 5] ?

Choose 2 answers

A.

[ ]. Concat.apply ([ ], inArray);

B.

[]. Concat (... inArray);

C.

[ ]. concat.apply(inArray, [ ]);

D.

[ ]. concat ( [ ….inArray ] );

Given the code below:

const delay = sync delay => {

Return new Promise((resolve, reject) => {

setTimeout (resolve,delay);});};

const callDelay =async () =>{

const yup =await delay(1000);

console.log(1);

What is logged to the console?

A.

1 2 3

B.

1 3 2

C.

2 1 3

D.

2 3 1

A developer is required to write a function that calculates the sum of elements in an

array but is getting undefined every time the code is executed. The developer needs to find

what is missing in the code below.

Const sumFunction = arr => {

Return arr.reduce((result, current) => {

//

Result += current;

//

), 10);

);

Which option makes the code work as expected?

A.

Replace line02 with return arr.map(( result, current) => (

B.

Replace line 04 with result = result +current;

C.

Replace line 03 with if(arr.length == 0 ) ( return 0; )

D.

Replace line 05 with return result;

Which code statement correctly retrieves and returns an object from localStorage?

A.

const retrieveFromLocalStorage = () =>{return JSON.stringify(window.localStorage.getItem(storageKey));}

B.

const retrieveFromLocalStorage = (storageKey) =>{return window.localStorage.getItem(storageKey);}

C.

const retrieveFromLocalStorage = (storageKey) =>{return JSON.parse(window.localStorage.getItem(storageKey));}

D.

constretrieveFromLocalStorage = (storageKey) =>{return window.localStorage[storageKey];}

Which statement accurately describes an aspect of promises?

A.

Arguments for the callback function passed to .then() are optional.

B.

In a.then() function, returning results is not necessary since callbacks will catch the result of a previous promise.

C.

.then() cannot be added after a catch.

D.

.then() manipulates and returns the original promise.

Refer to the code below:

let timeFunction =() => {

console.log(‘Timer called.”);

};

let timerId = setTimeout (timedFunction, 1000);

Which statement allows a developer to cancel the scheduled timed function?

A.

removeTimeout(timedFunction);

B.

removeTimeout(timerId);

C.

clearTimeout(timerId);

D.

clearTimeout(timedFunction);

Consider type coercion, what does the following expression evaluate to?

True + 3 + ‘100’ + null

A.

104

B.

4100

C.

‘3100null’

D.

‘4100null’

Refer to HTML below:

This card is smaller.

The width and height of this card is determined by its

contents.

Which expression outputs the screen width of the element with the ID card-01?

A.

document.getElementById(‘ card-01 ’).getBoundingClientRest().width

B.

document.getElementById(‘ card-01 ’).style.width

C.

document.getElementById(‘ card-01 ’).width

D.

document.getElementById(‘ card-01 ’).innerHTML.lenght*e

Which two console logs outputs NaN ?

Choose 2 answers

A.

console.log(10/ Number(‘5’));

B.

console.log(parseInt(‘two’));

C.

console.log(10/ ‘’five);

D.

console.log(10/0);

A developer wants to iterate through an array of objects and count the objects and count

the objects whose property value, name, starts with the letterN.

Const arrObj = [{“name” : “Zach”} , {“name” : “Kate”},{“name” : “Alise”},{“name” : “Bob”},{“name” :

“Natham”},{“name” : “nathaniel”}

Refer to the code snippet below:

01 arrObj.reduce(( acc, curr) => {

02 //missing line 02

02 //missing line 03

04 ). 0);

Which missing lines 02 and 03 return the correct count?

A.

Const sum = curr.startsWith(‘N’) ? 1: 0;Return acc +sum

B.

Const sum = curr.name.startsWith(‘N’) ? 1: 0;Return acc +sum

C.

Const sum = curr.startsWIth(‘N’) ? 1: 0;Return curr+ sum

D.

Const sum =curr.name.startsWIth(‘N’) ? 1: 0;Return curr+ sum

Page: 3 / 4
Total 219 questions
Copyright © 2014-2025 Solution2Pass. All Rights Reserved