ExamGecko
Ask Question

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

List of questions

Question 41

Report Export Collapse

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

Choose 3 answers !

value == NaN
value == NaN
Object.is(value, NaN)
Object.is(value, NaN)
value === Number.NaN
value === Number.NaN
value ! == value
value ! == value
Number.isNaN(value)
Number.isNaN(value)
Suggested answer: A, E
asked 23/09/2024
Waleed Bahadaq
44 questions

Question 42

Report Export Collapse

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 ?

import * ad lib from '/path/universalContainersLib.js'; lib.foo(); lib.bar();
import * ad lib from '/path/universalContainersLib.js'; lib.foo(); lib.bar();
import (foo, bar) from '/path/universalContainersLib.js'; foo(); bar();
import (foo, bar) from '/path/universalContainersLib.js'; foo(); bar();
import all from '/path/universalContaineraLib.js'; universalContainersLib.foo(); universalContainersLib.bar();
import all from '/path/universalContaineraLib.js'; universalContainersLib.foo(); universalContainersLib.bar();
import * from '/path/universalContaineraLib.js'; universalContainersLib.foo(); universalContainersLib.bar();
import * from '/path/universalContaineraLib.js'; universalContainersLib.foo(); universalContainersLib.bar();
Suggested answer: A
asked 23/09/2024
Luca Bombelli
40 questions

Question 43

Report Export Collapse

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?

"Username available"
"Username available"
"newUserName"
"newUserName"
"Msg is not defined"
"Msg is not defined"
undefined
undefined
Suggested answer: D
asked 23/09/2024
Nick Sheremet
29 questions

Question 44

Report Export Collapse

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

Salesforce Certified JavaScript Developer I image Question 44 63715 09232024002545000000

Suggested answer: A
asked 23/09/2024
Sterling White
52 questions

Question 45

Report Export Collapse

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?

const https =require('https');
const https =require('https');
const server =require('secure-server');
const server =require('secure-server');
const tls = require('tls');
const tls = require('tls');
const http =require('http');
const http =require('http');
Suggested answer: A
asked 23/09/2024
ivaylo Skechleiev
41 questions

Question 46

Report Export Collapse

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?

1 2 3
1 2 3
1 3 2
1 3 2
2 1 3
2 1 3
2 3 1
2 3 1
Suggested answer: D
asked 23/09/2024
Jaques Rautenbach
40 questions

Question 47

Report Export Collapse

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?

[1,2]
[1,2]
["bar","foo"]
["bar","foo"]
["foo","bar"]
["foo","bar"]
["foo:1","bar:2"]
["foo:1","bar:2"]
Suggested answer: C
asked 23/09/2024
Hector Quintero
50 questions

Question 48

Report Export Collapse

Refer to the code below?

Let searchString = ' look for this ';

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

Choose 2 answers

searchString.trimEnd();
searchString.trimEnd();
searchString.trimStart();
searchString.trimStart();
trimStart(searchString);
trimStart(searchString);
searchString.replace(/*\s\s*/, '');
searchString.replace(/*\s\s*/, '');
Suggested answer: B, D
asked 23/09/2024
First Last
38 questions

Question 49

Report Export Collapse

Which three actions can be using the JavaScript browser console?

Choose 3 answers:

View and change DOM the page.
View and change DOM the page.
Display a report showing the performance of a page.
Display a report showing the performance of a page.
Run code that is not related to page.
Run code that is not related to page.
view , change, and debug the JavaScript code of the page.
view , change, and debug the JavaScript code of the page.
View and change security cookies.
View and change security cookies.
Suggested answer: A, C, D
asked 23/09/2024
Rosalba Scalera
57 questions

Question 50

Report Export Collapse

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

The function has an error that should not be silenced.
The function has an error that should not be silenced.
The function results in an out of memory issue.
The function results in an out of memory issue.
The function might raise a runtime error that needs to be handled.
The function might raise a runtime error that needs to be handled.
The function contains scheduled code.
The function contains scheduled code.
Suggested answer: C
asked 23/09/2024
FARIZA MANNAN
42 questions
Total 224 questions
Go to page: of 23
Search

Related questions