ExamGecko
Home Home / Salesforce / Certified JavaScript Developer I

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

Question list
Search
Search

List of questions

Search

Related questions











developer is trying to convince management that their team will benefit from using Node.js for a backend server that they are going to create. The server will be a web server that handles API requests from a website that the team has already built using HTML, CSS, and JavaScript.

Which three benefits of Node.js can the developer use to persuade their manager?

Choose 3 answers:

A.
Installs with its own package manager to install and manage third-party libraries.
A.
Installs with its own package manager to install and manage third-party libraries.
Answers
B.
Ensures stability with one major release every few years.
B.
Ensures stability with one major release every few years.
Answers
C.
Performs a static analysis on code before execution to look for runtime errors.
C.
Performs a static analysis on code before execution to look for runtime errors.
Answers
D.
Executes server-side JavaScript code to avoid learning a new language.
D.
Executes server-side JavaScript code to avoid learning a new language.
Answers
E.
Uses non-blocking functionality for performant request handling .
E.
Uses non-blocking functionality for performant request handling .
Answers
Suggested answer: A, C, E

A developer is wondering whether to use, Promise.then or Promise.catch, especially when a Promise throws an error?

Which two promises are rejected?

Which 2 are correct?

A.
Promise.reject('cool error here').then(error => console.error(error));
A.
Promise.reject('cool error here').then(error => console.error(error));
Answers
B.
Promise.reject('cool error here').catch(error => console.error(error));
B.
Promise.reject('cool error here').catch(error => console.error(error));
Answers
C.
New Promise((resolve, reject) => (throw 'cool error here'}).catch(error => console.error(error)) ;
C.
New Promise((resolve, reject) => (throw 'cool error here'}).catch(error => console.error(error)) ;
Answers
D.
New Promise(() => (throw 'cool error here'}).then(null, error => console.error(error)));
D.
New Promise(() => (throw 'cool error here'}).then(null, error => console.error(error)));
Answers
Suggested answer: B, C

Refer to code below:

function Person() {

this.firstName = 'John';

}

Person.prototype ={

Job: x => 'Developer'

};

const myFather = new Person();

const result =myFather.firstName + ' ' + myFather.job();

What is the value of the result after line 10 executes?

A.
Error: myFather.job is not a function
A.
Error: myFather.job is not a function
Answers
B.
Undefined Developer
B.
Undefined Developer
Answers
C.
John undefined
C.
John undefined
Answers
D.
John Developer
D.
John Developer
Answers
Suggested answer: D

Universal Containers (UC) notices that its application that allows users to search for accounts makes a network request each time a key is pressed. This results in too many requests for the server to handle.

• Address this problem, UC decides to implement a debounce function on string change handler.

What are three key steps to implement this debounce function?

Choose 3 answers:

A.
If there is an existing setTimeout and the search string change, allow the existing setTimeout to finish, and do not enqueue a new setTimeout.
A.
If there is an existing setTimeout and the search string change, allow the existing setTimeout to finish, and do not enqueue a new setTimeout.
Answers
B.
When the search string changes, enqueue the request within a setTimeout.
B.
When the search string changes, enqueue the request within a setTimeout.
Answers
C.
Ensure that the network request has the property debounce set to true.
C.
Ensure that the network request has the property debounce set to true.
Answers
D.
If there is an existing setTimeout and the search string changes, cancel the existing setTimeout using the persisted timerId and replace it with a new setTimeout.
D.
If there is an existing setTimeout and the search string changes, cancel the existing setTimeout using the persisted timerId and replace it with a new setTimeout.
Answers
E.
Store the timeId of the setTimeout last enqueued by the search string change handle.
E.
Store the timeId of the setTimeout last enqueued by the search string change handle.
Answers
Suggested answer: A, B, C

Refer to the following object:

const cat ={

firstName: 'Fancy',

lastName: ' Whiskers',

Get fullName() {

return this.firstName + ' ' + this.lastName;

}

};

How can a developer access the fullName property for cat?

A.
cat.fullName
A.
cat.fullName
Answers
B.
cat.fullName()
B.
cat.fullName()
Answers
C.
cat.get.fullName
C.
cat.get.fullName
Answers
D.
cat.function.fullName()
D.
cat.function.fullName()
Answers
Suggested answer: A

Refer to following code:

class Vehicle {

constructor(plate) {

This.plate =plate;

}}

Class Truck extends Vehicle {

constructor(plate, weight) {

//Missing code

This.weight = weight;

}

displayWeight() {

console.log('The truck ${this.plate} has a weight of ${this.weight} lb.');}}

Let myTruck = new Truck('123AB', 5000);

myTruck.displayWeight();

Which statement should be added to line 09 for the code to display 'The truck 123AB has a weight of 5000lb.'?

A.
Super.plate =plate;
A.
Super.plate =plate;
Answers
B.
super(plate);
B.
super(plate);
Answers
C.
This.plate =plate;
C.
This.plate =plate;
Answers
D.
Vehicle.plate = plate;
D.
Vehicle.plate = plate;
Answers
Suggested answer: B

Which option is a core Node,js module?

A.
Path
A.
Path
Answers
B.
Ios
B.
Ios
Answers
C.
Memory
C.
Memory
Answers
D.
locate
D.
locate
Answers
Suggested answer: A

Refer to the code snippet below:

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

For (let i =0; i < array.length; i++){

if (array[i] === 4) { array.splice(i, 1);

}

}

What is the value of the array after the code executes?

A.
[1, 2, 3, 4, 5, 4, 4]
A.
[1, 2, 3, 4, 5, 4, 4]
Answers
B.
[1, 2, 3, 4, 4, 5, 4]
B.
[1, 2, 3, 4, 4, 5, 4]
Answers
C.
[1, 2, 3, 4, 5, 4]
C.
[1, 2, 3, 4, 5, 4]
Answers
D.
[1, 2, 3, 5]
D.
[1, 2, 3, 5]
Answers
Suggested answer: C

Which option is true about the strict mode in imported modules?

A.
Add the statement use non-strict, before any other statements in the module to enable not-strict mode.
A.
Add the statement use non-strict, before any other statements in the module to enable not-strict mode.
Answers
B.
You can only reference notStrict() functions from the imported module.
B.
You can only reference notStrict() functions from the imported module.
Answers
C.
Imported modules are in strict mode whether you declare them as such or not.
C.
Imported modules are in strict mode whether you declare them as such or not.
Answers
D.
Add the statement use strict =false; before any other statements in the module to enable not- strict mode.
D.
Add the statement use strict =false; before any other statements in the module to enable not- strict mode.
Answers
Suggested answer: B

Teams at Universal Containers (UC) work on multiple JavaScript projects at the same time.

UC is thinking about reusability and how each team can benefit from the work of others.

Going open-source or public is not an option at this time.

Which option is available to UC with npm?

A.
Private packages can be scored, and scopes can be associated to a private registries.
A.
Private packages can be scored, and scopes can be associated to a private registries.
Answers
B.
Private registries are not supported by npm, but packages can be installed via URL.
B.
Private registries are not supported by npm, but packages can be installed via URL.
Answers
C.
Private packages are not supported, but they can use another package manager like yarn.
C.
Private packages are not supported, but they can use another package manager like yarn.
Answers
D.
Private registries are not supported by npm, but packages can be installed via git.
D.
Private registries are not supported by npm, but packages can be installed via git.
Answers
Suggested answer: A
Total 224 questions
Go to page: of 23