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

Salesforce JavaScript-Developer-I - Salesforce Certified JavaScript Developer (JS-Dev-101)

Page: 1 / 7
Total 219 questions

A developer wants to set up a secure web server withNode.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?

A.

const https =require(‘https’);

B.

const server =require(‘secure-server’);

C.

const tls = require(‘tls’);

D.

const http =require(‘http’);

Refer to the code below:

function changeValue(param) {

Param =5;

}

Let a =10;

Let b =5;

changeValue(b);

Const result = a+ “ - ”+ b;

What is the value of result when code executes?

A.

10 -10

B.

5 -5

C.

5 - 10

D.

10 - 5

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;

Given the following code:

Let x =(‘15’ + 10)*2;

What is the value of a?

A.

3020

B.

1520

C.

50

D.

35

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

turn around 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?

A.

DEBUG = http, https node server.js

B.

NODE_DEBUG =http, https node server.js

C.

DEBUG =true node server.js

D.

NODE_DEBUG =true node server.js

Which statement parses successfully?

A.

JSON. parse (""foo"');

B.

JSON.parse (""foo'");

C.

JSON.parse ("foo");

D.

JSON.parse ("foo");

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

A.

Integration

B.

Black box

C.

White box

D.

Mocking

Refer to the following code:

Let sampleText = ‘The quick brown fox jumps’;

A developer needs to determine if a certainsubstring is part of a string.

Which three expressions return true for the given substring ?

Choose 3 answers

A.

sampleText.includes(‘fox’);

B.

sampleText.includes(‘ quick ’, 4);

C.

sampleText.includes(‘ Fox ’, 3)

D.

sampleText.includes(‘ fox ’);

E.

sampleText.includes(‘ quick ’) !== -1;

A developer has two ways to write a function:

Option A:

function Monster(){

this.growl = ()=>{

console.log('Grr!');

}

}

Option B:

function Monster(){};

Monster.prototype.growl = ()=>{

console.log('Grr!');

}

After deciding on an option, the developercreates 1000 monster objects.

How many growl methods are created with Option A and Option B?

A.

1000 for Option A, 1 for Option B

B.

1 methods for both

C.

1000 for both

D.

1 for Option A, 1000 for Option B

Refer to code below:

Let first = ‘who’;

Let second = ‘what’;

Try{

Try{

Throw new error(‘Sad trombone’);

}catch (err){

First =’Why’;

}finally {

Second =’when’;

} catch (err) {

Second =’Where’;

}

What are the values for first and second once the code executes ?

A.

First is Who and second is When

B.

First is why and second is where

C.

First is who and second is where

D.

First is why and second is when