ExamGecko
Ask Question

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

Add to Whishlist

List of questions

Question 141

Report Export Collapse

Refer to code below:

Const objBook = {

Title: 'Javascript',

}; Object.preventExtensions(objBook);

Const newObjBook = objBook;

newObjectBook.author = 'Robert';

What are the values of objBook and newObjBook respectively ?

Become a Premium Member for full access
  Unlock Premium Member

Question 142

Report Export Collapse

Refer to code below:

console.log(0);

setTimeout(() => (

console.log(1);

});

console.log(2);

setTimeout(() => {

console.log(3);

), 0);

console.log(4);

In which sequence will the numbers be logged?

Become a Premium Member for full access
  Unlock Premium Member

Question 143

Report Export Collapse

A developer implements and calls the following code when an application state change occurs:

Const onStateChange =innerPageState) => {

window.history.pushState(newPageState, ' ', null);

}

If the back button is clicked after this method is executed, what can a developer expect?

Become a Premium Member for full access
  Unlock Premium Member

Question 144

Report Export Collapse

Refer to the expression below:

Let x = ('1' + 2) == (6 * 2);

How should this expression be modified to ensure that evaluates to false?

Become a Premium Member for full access
  Unlock Premium Member

Question 145

Report Export Collapse

A developer wants to define a function log to be used a few times on a single-file JavaScript script.

01 // Line 1 replacement

02 console.log('"LOG:', logInput);

03 }

Which two options can correctly replace line 01 and declare the function for use?

Choose 2 answers

Become a Premium Member for full access
  Unlock Premium Member

Question 146

Report Export Collapse

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

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

Become a Premium Member for full access
  Unlock Premium Member

Question 147

Report Export Collapse

Which two console logs output NaN?

Choose 2 answers | |

Become a Premium Member for full access
  Unlock Premium Member

Question 148

Report Export Collapse

A developer wants to use a try...catch statement to catch any error that countSheep () may throw and pass it to a handleError () function.

What is the correct implementation of the try...catch?

Become a Premium Member for full access
  Unlock Premium Member

Question 149

Report Export Collapse

A developer has a formatName function that takes two arguments, firstName and lastName and returns a string. They want to schedule the function to run once after five seconds.

What is the correct syntax to schedule this function?

Become a Premium Member for full access
  Unlock Premium Member

Question 150

Report Export Collapse

Which statement parses successfully?

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

Related questions