Special Summer Sale 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: Board70

JavaScript-Developer-I Exam Dumps - Salesforce Developer Questions and Answers

Question # 4

Refer the code below.

x=3.14;

function myfunction() {

"use strict";

y=x;

}

z=x;

myFunction();

Options:

Buy Now
Question # 5

Refer to code below:

Function muFunction(reassign){

Let x = 1;

var y = 1;

if( reassign ) {

Let x= 2;

Var y = 2;

console.log(x);

console.log(y);}

console.log(x);

console.log(y);}

What is displayed when myFunction(true) is called?

Options:

A.

2 2 1 1

B.

2 2 undefined undefined

C.

2 2 1 2

D.

2 2 2 2

Buy Now
Question # 6

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?

Options:

A.

2.0.0

B.

1.2.3

C.

1.1.4

D.

1.2.0

Buy Now
Question # 7

Why would a developer specify a package.jason as a developed forge instead of a dependency ?

Options:

A.

It is required by the application in production.

B.

It is only needed for local development and testing.

C.

Other required packages depend on it for development.

D.

It should be bundled when the package is published.

Buy Now
Question # 8

Refer to the following code:

What is the output of line 11?

Options:

A.

[1,2]

B.

["bar", "foo"]

C.

["foo:1", "bar:2"]

D.

["foo", "bar"]

Buy Now
Question # 9

is below:

<input type=”file” onchange=”previewFile()”>

”Image

The JavaScript portion is:

01 function previewFile(){

02 const preview = document.querySelector(‘img’);

03 const file = document.querySelector(‘input[type=file]’).files[0];

04 //line 4 code

05 reader.addEventListener(“load”, () => {

06 preview.src = reader.result;

07 },false);

08 //line 8 code

09 }

In lines 04 and 08, which code allows the user to select an image from their local

computer , and to display the image in the browser?

Options:

A.

04 const reader = new File();

08 if (file) URL.createObjectURL(file);

B.

04 const reader = new FileReader();

08 if (file) URL.createObjectURL(file);

C.

04 const reader = new File();

08 if (file) reader.readAsDataURL(file);

D.

04 const reader = new FileReader();

08 if (file) reader.readAsDataURL(file);

Buy Now
Question # 10

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?

Options:

A.

Replace line 02 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;

Buy Now
Question # 11

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?

Options:

A.

node -i server.js

B.

node inspect server,js

C.

node server,js inspect

D.

node start inspect server,js

Buy Now
Question # 12

A developer has a web server running with Node.js. The command to start the web server is node server.js. The web server started having

latency issues. Instead of a one second turnaround for web requests, the developer now sees a five second turnaround.

Which command can the web developer run to see what the module is doing during the latency period?

Options:

A.

NODE_DEBUG=true node server.js

B.

DEBUG=http, https node server.js

C.

NODE_DEBUG=http,https node server.js

D.

DEBUG=true node server.js

Buy Now
Question # 13

A test has a dependency on database.query. During the test the dependency is replaced

with an object called database with the method, query, that returns an array. The

developer needs to verify how many times the method was called and the arguments

used each time.

Which two test approaches describe the requirement?

Choose 2 answers

Options:

A.

Integration

B.

Black box

C.

White box

D.

Mocking

Buy Now
Exam Name: Salesforce Certified JavaScript Developer I (WI25)
Last Update: Mar 29, 2025
Questions: 215
JavaScript-Developer-I pdf

JavaScript-Developer-I PDF

$25.5  $84.99
JavaScript-Developer-I Engine

JavaScript-Developer-I Testing Engine

$28.5  $94.99
JavaScript-Developer-I PDF + Engine

JavaScript-Developer-I PDF + Testing Engine

$40.5  $134.99