ExamGecko
Home Home / Salesforce / Certified JavaScript Developer I

Salesforce Certified JavaScript Developer I Practice Test - Questions Answers, Page 5

Question list
Search
Search

List of questions

Search

Related questions











GIven a value, which three options can a developer use to detect if the value is NaN?

Choose 3 answers !

A.
value == NaN
A.
value == NaN
Answers
B.
Object.is(value, NaN)
B.
Object.is(value, NaN)
Answers
C.
value === Number.NaN
C.
value === Number.NaN
Answers
D.
value ! == value
D.
value ! == value
Answers
E.
Number.isNaN(value)
E.
Number.isNaN(value)
Answers
Suggested answer: A, E

developer wants to use a module named universalContainersLib and them call functions from it.

How should a developer import every function from the module and then call the fuctions foo and bar ?

A.
import * ad lib from '/path/universalContainersLib.js'; lib.foo(); lib.bar();
A.
import * ad lib from '/path/universalContainersLib.js'; lib.foo(); lib.bar();
Answers
B.
import (foo, bar) from '/path/universalContainersLib.js'; foo(); bar();
B.
import (foo, bar) from '/path/universalContainersLib.js'; foo(); bar();
Answers
C.
import all from '/path/universalContaineraLib.js'; universalContainersLib.foo(); universalContainersLib.bar();
C.
import all from '/path/universalContaineraLib.js'; universalContainersLib.foo(); universalContainersLib.bar();
Answers
D.
import * from '/path/universalContaineraLib.js'; universalContainersLib.foo(); universalContainersLib.bar();
D.
import * from '/path/universalContaineraLib.js'; universalContainersLib.foo(); universalContainersLib.bar();
Answers
Suggested answer: A

Refer to the code snippet:

Function getAvailabilityMessage(item) {

If (getAvailability(item)){

Var msg ="Username available";

}

Return msg;

}

A developer writes this code to return a message to user attempting to register a new username. If the username is available, variable.

What is the return value of msg hen getAvailabilityMessage ("newUserName" ) is executed and getAvailability("newUserName") returns false?

A.
"Username available"
A.
"Username available"
Answers
B.
"newUserName"
B.
"newUserName"
Answers
C.
"Msg is not defined"
C.
"Msg is not defined"
Answers
D.
undefined
D.
undefined
Answers
Suggested answer: D

Given the requirement to refactor the code above to JavaScript class format, which class definition is correct?

A.
A.
Answers
B.
B.
Answers
C.
C.
Answers
D.
D.
Answers
Suggested answer: A

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?

A.
const https =require('https');
A.
const https =require('https');
Answers
B.
const server =require('secure-server');
B.
const server =require('secure-server');
Answers
C.
const tls = require('tls');
C.
const tls = require('tls');
Answers
D.
const http =require('http');
D.
const http =require('http');
Answers
Suggested answer: A

Given the code below:

const delay = sync delay => {

Return new Promise((resolve, reject) => {

setTimeout (resolve, delay);});};

const callDelay =async () =>{

const yup =await delay(1000);

console.log(1);

What is logged to the console?

A.
1 2 3
A.
1 2 3
Answers
B.
1 3 2
B.
1 3 2
Answers
C.
2 1 3
C.
2 1 3
Answers
D.
2 3 1
D.
2 3 1
Answers
Suggested answer: D

Refer to the following code:

Let obj ={

Foo: 1,

Bar: 2

}

Let output =[],

for(let something in obj{

output.push(something);

} console.log(output);

What is the output line 11?

A.
[1,2]
A.
[1,2]
Answers
B.
["bar","foo"]
B.
["bar","foo"]
Answers
C.
["foo","bar"]
C.
["foo","bar"]
Answers
D.
["foo:1","bar:2"]
D.
["foo:1","bar:2"]
Answers
Suggested answer: C

Refer to the code below?

Let searchString = ' look for this ';

Which two options remove the whitespace from the beginning of searchString?

Choose 2 answers

A.
searchString.trimEnd();
A.
searchString.trimEnd();
Answers
B.
searchString.trimStart();
B.
searchString.trimStart();
Answers
C.
trimStart(searchString);
C.
trimStart(searchString);
Answers
D.
searchString.replace(/*\s\s*/, '');
D.
searchString.replace(/*\s\s*/, '');
Answers
Suggested answer: B, D

Which three actions can be using the JavaScript browser console?

Choose 3 answers:

A.
View and change DOM the page.
A.
View and change DOM the page.
Answers
B.
Display a report showing the performance of a page.
B.
Display a report showing the performance of a page.
Answers
C.
Run code that is not related to page.
C.
Run code that is not related to page.
Answers
D.
view , change, and debug the JavaScript code of the page.
D.
view , change, and debug the JavaScript code of the page.
Answers
E.
View and change security cookies.
E.
View and change security cookies.
Answers
Suggested answer: A, C, D

In which situation should a developer include a try .. catch block around their function call ?

A.
The function has an error that should not be silenced.
A.
The function has an error that should not be silenced.
Answers
B.
The function results in an out of memory issue.
B.
The function results in an out of memory issue.
Answers
C.
The function might raise a runtime error that needs to be handled.
C.
The function might raise a runtime error that needs to be handled.
Answers
D.
The function contains scheduled code.
D.
The function contains scheduled code.
Answers
Suggested answer: C
Total 224 questions
Go to page: of 23