ExamGecko
Ask Question

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

Add to Whishlist

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
47 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
41 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
28 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

Become a Premium Member for full access
  Unlock Premium Member

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?

Become a Premium Member for full access
  Unlock Premium Member

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?

Become a Premium Member for full access
  Unlock Premium Member

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?

Become a Premium Member for full access
  Unlock Premium Member

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

Become a Premium Member for full access
  Unlock Premium Member

Question 49

Report Export Collapse

Which three actions can be using the JavaScript browser console?

Choose 3 answers:

Become a Premium Member for full access
  Unlock Premium Member

Question 50

Report Export Collapse

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

Become a Premium Member for full access
  Unlock Premium Member
Total 224 questions
Go to page: of 23
Search

Related questions