ExamGecko
Ask Question

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

Add to Whishlist

List of questions

Question 131

Report Export Collapse

Refer to the code below:

Refer to the code below:

Const resolveAfterMilliseconds = (ms) => Promise.resolve (

setTimeout (( => console.log(ms), ms ));

Const aPromise = await resolveAfterMilliseconds(500);

Const bPromise = await resolveAfterMilliseconds(500);

Await aPromise, wait bPromise;

What is the result of running line 05?

Become a Premium Member for full access
  Unlock Premium Member

Question 132

Report Export Collapse

Refer to the code below:

Const searchTest = 'Yay! Salesforce is amazing!" ;

Let result1 = searchText.search(/sales/i);

Let result 21 = searchText.search(/sales/i);

console.log(result1);

console.log(result2);

After running this code, which result is displayed on the console?

Become a Premium Member for full access
  Unlock Premium Member

Question 133

Report Export Collapse

Why would a developer specify a package.jason as a developed forge instead of a dependency ?

Become a Premium Member for full access
  Unlock Premium Member

Question 134

Report Export Collapse

Refer to the code below:

let o = {

get js() {

let city1 = String("st. Louis");

let city2 = String(" New York");

return {

firstCity: city1.toLowerCase(),

secondCity: city2.toLowerCase(),

What value can a developer expect when referencing o.js.secondCity?

Become a Premium Member for full access
  Unlock Premium Member

Question 135

Report Export Collapse

Given the code below:

Setcurrent URL ();

console.log('The current URL is: ' +url );

function setCurrentUrl() {

Url = window.location.href:

What happens when the code executes?

What happens when the code executes?

Become a Premium Member for full access
  Unlock Premium Member

Question 136

Report Export Collapse

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 developer creates 1000 monster objects.

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

Become a Premium Member for full access
  Unlock Premium Member

Question 137

Report Export Collapse

Which three browser specific APIs are available for developers to persist data between page loads ?

Choose 3 answers

Become a Premium Member for full access
  Unlock Premium Member

Question 138

Report Export Collapse

Refer to the code below:

Const myFunction = arr => {

Return arr.reduce((result, current) =>{

Return result = current;

}, 10};

}

What is the output of this function when called with an empty array ?

Become a Premium Member for full access
  Unlock Premium Member

Question 139

Report Export Collapse

In the browser, the window object is often used to assign variables that require the broadest scope in an application Node.js application does not have access to the window object by default.

Which two methods are used to address this ?

Choose 2 answers

Become a Premium Member for full access
  Unlock Premium Member

Question 140

Report Export Collapse

Refer to the following array:

Let arr = [ 1,2, 3, 4, 5];

Which three options result in x evaluating as [3, 4, 5] ?

Choose 3 answers.

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

Related questions