Spring Sale 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: save70

Selected JavaScript-Developer-I Salesforce Developer Questions Answers

Salesforce Certified JavaScript Developer (JS-Dev-101) Questions and Answers

Question 5

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

true + ' 13 ' + NaN

Options:

A.

' true13NaN '

B.

' 113NaN '

C.

14

D.

' true13 '

Question 6

A developer writes the code below to return a message to a user attempting to register a new username. If the username is available, a variable named msg is declared and assigned a value on line 03.

function getAvailabilityMessage(item) {

if (getAvailability(item)) {

var msg = " Username available " ;

return msg;

}

}

Options:

A.

" msg is not defined "

B.

" newUserName "

C.

" Username available "

D.

undefined

Question 7

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);

Question 8

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?

(With corrected typing errors: node_inspect → node inspect, node_start_inspect → node start inspect.)

Options:

A.

node start inspect server.js

B.

node inspect server.js

C.

node server.js --inspect

D.

node -i server.js