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

Free Salesforce Certified JavaScript Developer (JS-Dev-101) Practice Questions

Question # 1

Refer to the code below:

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

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

(With corrected typing errors: usArray → inArray, .. → ....)

Options:

A.  

[].concat(...inArray);

B.  

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

C.  

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

D.  

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

Discussion 0
Question # 2

Which actions can be done using the JavaScript browser console?

Options:

A.  

Run code that’s not related to the page

B.  

View and change the DOM of the page

C.  

Display a report showing the performance of a page

D.  

Change the DOM and the JavaScript code of the page

E.  

View and change security cookies

Discussion 0
Question # 3

Given the code:

const copy = JSON.stringify([new String( ' false ' ), new Boolean(false), undefined]);

What is the value of copy?

Options:

A.  

' [ " false " , false, null] '

B.  

' [false, {}] '

C.  

' [ " false " , false, undefined] '

D.  

' [ " false " , {}] '

Discussion 0
Question # 4

A developer is setting up a new Node.js server with a client library that is built using events and callbacks.

The library:

    Will establish a web socket connection and handle receipt of messages to the server.

    Will be imported with require, and made available with a variable called ws.

    The developer also wants to add error logging if a connection fails.

Given this information, which code segment shows the correct way to set up a client with two events that listen at execution time?

Options:

A.  

ws.connect(() = > {

console.log( ' Connected to client ' );

}).catch((error) = > {

console.log( ' ERROR ' , error);

});

B.  

ws.on( ' connect ' , () = > {

console.log( ' Connected to client ' );

});

ws.on( ' error ' , (error) = > {

console.log( ' ERROR ' , error);

});

C.  

ws.on( ' connect ' , () = > {

console.log( ' Connected to client ' );

});

ws.on( ' error ' , (error) = > {

console.log( ' ERROR ' , error);

});

D.  

try {

ws.connect(() = > {

console.log( ' Connected to client ' );

});

} catch(error) {

console.log( ' ERROR ' , error);

}

Discussion 0
Question # 5

Refer to the code below:

01 let sayHello = () = > {

02 console.log( ' Hello, World! ' );

03 };

Which code executes sayHello once , two minutes from now?

Options:

A.  

delay(sayHello, 120000);

B.  

setTimeout(sayHello, 120000);

C.  

setTimeout(sayHello(), 120000);

D.  

setInterval(sayHello, 120000);

Discussion 0
Question # 6

A developer executes:

document.cookie;

document.cookie = ' key=John Smith ' ;

What is the behavior?

Options:

A.  

Cookies are read and the key value is set, the remaining cookies are unaffected.

B.  

Cookies are read, but the key value is not set because the value is not URL encoded.

C.  

Cookies are not read because line 01 should be document.cookies, but the key value is set and all cookies are wiped.

D.  

Cookies are read and the key value is set, and all cookies are wiped.

Discussion 0
Question # 7

Refer to the code:

01 const exec = (item, delay) = >

02 new Promise(resolve = > setTimeout(() = > resolve(item), delay));

03

04 async function runParallel() {

05 const [result1, result2, result3] = await Promise.all(

06 [exec( ' x ' , ' 100 ' ), exec( ' y ' , ' 500 ' ), exec( ' z ' , ' 100 ' )]

07 );

08 return `parallel is done: ${result1}${result2}${result3}`;

09 }

Which two statements correctly execute runParallel()?

Options:

A.  

async runParallel().then(data);

B.  

runParallel().then(function(data){

return data;

});

C.  

runParallel().done(function(data){

return data;

});

D.  

runParallel().then(data);

Discussion 0
Question # 8

01 function changeValue(obj) {

02 obj.value = obj.value / 2;

03 }

04 const objA = {value: 10};

05 const objB = objA;

06

07 changeValue(objB);

08 const result = obj

A.  

value;

What is the value of result after the code executes?

Options:

A.  

low

B.  

10

C.  

5

D.  

undefined

Discussion 0
Question # 9

Given a value, which three options can a developer use to detect if the value is NaN?

Options:

A.  

value === Number.NaN

B.  

value == NaN

C.  

Object.is(value, NaN)

D.  

value !== value

E.  

Number.isNaN(value)

Discussion 0
Question # 10

A developer initiates a server with the file server.js and adds dependencies in the source code ' s package.json that are required to run the server.

Which command should the developer run to start the server locally?

Options:

A.  

node start

B.  

npm start

C.  

npm start server.js

D.  

start server.js

Discussion 0

JavaScript-Developer-I PDF

JavaScript-Developer-I PDF (Printable)
$54.25
$154.99

JavaScript-Developer-I Testing Engine

JavaScript-Developer-I PDF (Printable)
$59.5
$169.99

JavaScript-Developer-I PDF + Testing Engine

JavaScript-Developer-I PDF (Printable)
$74.55
$212.99
Exams4sure Dumps

Exam style questions across every JavaScript-Developer-I domain

Last Update 1 day ago
Total Questions : 147

Start with our free JavaScript-Developer-I practice questions, carefully crafted to mirror the domains, phrasing, and difficulty of the real Salesforce Developer exam. Each JavaScript-Developer-I exam question comes with a detailed rationale that explains not just which answer is correct but why the others fall short. That's how concepts stick. Use the free set to benchmark yourself: identify your Salesforce weak domains, see where you're losing marks, and build a focused study plan in minutes.

Free Exams Sample Questions