Pass the Salesforce Salesforce Developer JavaScript-Developer-I Questions and answers with CertsForce

Viewing page 5 out of 7 pages
Viewing questions 41-50 out of questions
Questions # 41:

Refer to the following code:

function test (val) {

If (val === undefined) {

return ‘Undefined values!’ ;

}

if (val === null) {

return ‘Null value! ’;

}

return val;

}

Let x;

test(x);

What is returned by the function call on line 13?

Options:

A.

Undefined


B.

Line 13 throws an error.


C.

‘Undefined values!’


D.

‘Null value!’


Expert Solution
Questions # 42:

Refer to thecode below:

Const pi = 3.1415326,

What is the data type of pi?

Options:

A.

Double


B.

Number


C.

Decimal


D.

Float


Expert Solution
Questions # 43:

Refer to HTML below:

This card is smaller.

The width and height of this card is determined by its

contents.

Which expression outputs the screen width of the element with the ID card-01?

Options:

A.

document.getElementById(‘ card-01 ’).getBoundingClientRest().width


B.

document.getElementById(‘ card-01 ’).style.width


C.

document.getElementById(‘ card-01 ’).width


D.

document.getElementById(‘ card-01 ’).innerHTML.lenght*e


Expert Solution
Questions # 44:

Given the JavaScript below:

Question # 44

Which code should replace the placeholder comment on line 06 to hide accounts that do not match the search string?

Options:

A.

‘None’ : ‘block’


B.

‘Visible : ’hidden’


C.

‘Hidden, visible


D.

‘Block’ : ‘none’


Expert Solution
Questions # 45:

A developer uses a parsed JSON string to work with user information as in the block below:

01 const userInformation ={

02 “ id ” : “user-01”,

03 “email” : “user01@universalcontainers.demo”,

04 “age” : 25

Which two options access the email attribute in the object?

Choose 2 answers

Options:

A.

userInformation(“email”)


B.

userInformation.get(“email”)


C.

userInformation.email


D.

userInformation(email)


Expert Solution
Questions # 46:

A developer implements a function that adds a few values.

Function sum(num) {

If (num == undefined) {

Num =0;

}

Return function( num2, num3){

If (num3 ===undefined) {

Num3 =0 ;

}

Return num + num2 + num3;

}

}

Which three options can the developer invoke for this function to get a return value of 10 ?

Choose 3 answers

Options:

A.

Sum () (20)


B.

Sum (5, 5) ()


C.

sum() (5, 5)


D.

sum(5)(5)


E.

sum(10) ()


Expert Solution
Questions # 47:

At Universal Containers, every team has its own way of copyingJavaScript objects. The code snippet shows an Implementation from one team:

Question # 47

What is the output of the code execution?

Options:

A.

Hello John Doe


B.

Hello Dan


C.

Hello Dan Doe


D.

SyntaxError: Unexpected token in JSON


Expert Solution
Questions # 48:

A test has a dependency on database. query. During the test, the dependency is replaced with an object called database with the method,

Calculator query, that returns an array. The developer does notneed to verify how many times the method has been called.

Which two test approaches describe the requirement?

Choose 2 answers

Options:

A.

White box


B.

Stubbing


C.

Black box


D.

Substitution


Expert Solution
Questions # 49:

A developer creates a genericfunction to log custom messages in the console. To do this,

the function below is implemented.

01 function logStatus(status){

02 console./*Answer goes here*/{‘Item status is: %s’, status};

03 }

Which three console logging methods allow the use of string substitution in line 02?

Options:

A.

Assert


B.

Log


C.

Message


D.

Info


E.

Error


Expert Solution
Questions # 50:

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?

Options:

A.

const https =require(‘https’);


B.

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


C.

const tls = require(‘tls’);


D.

const http =require(‘http’);


Expert Solution
Viewing page 5 out of 7 pages
Viewing questions 41-50 out of questions