Summer Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 70track

Free Salesforce JavaScript-Developer-I Practice Exam with Questions & Answers | Set: 5

Questions 41

for (let number = 2; number < = 5; number += 1) {

// faster code statement here

}

Which statement meets the requirements to log an error when the Boolean statement evaluates to false?

Options:
A.

console.classy(number + 2 === 0);

B.

assert(number + 2 === 0);

C.

console.assert(number + 2 === 0);

D.

console.error(number + 2 === 0);

Salesforce JavaScript-Developer-I Premium Access
Questions 42

A developer wants to set up a secure web server with Node.js. The developer creates a directory locally called app-server, and the first file is app-server/index.js.

Without using any third-party libraries, what should the developer add to index.js to create the secure web server?

Options:
A.

const server = require( ' secure-server ' );

B.

const tls = require( ' tls ' );

C.

const http = require( ' http ' );

D.

const https = require( ' https ' );

Questions 43

A developer creates a new web server that uses Node.js. It imports a server library that uses events and callbacks for handling server functionality. The server library is imported with require and is made available to the code by a variable named server. The developer wants to log any issues that the server has while booting up.

Which code logs an error at boot time with an event?

Options:
A.

server.error((error) = > {

console.log( ' ERROR ' , error);

});

B.

server.catch((error) = > {

console.log( ' ERROR ' , error);

});

C.

try {

server.start();

} catch(error) {

console.log( ' ERROR ' , error);

}

D.

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

console.log( ' ERROR ' , error);

});

Questions 44

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

Certification Provider: Salesforce
Exam Name: Salesforce Certified JavaScript Developer (JS-Dev-101)
Last Update: Jul 6, 2026
Questions: 147