ExamGecko
Home Home / Salesforce / Certified JavaScript Developer I

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

Question list
Search
Search

List of questions

Search

Related questions











A team that works on a big project uses npm to deal with projects dependencies.

A developer added a dependency does not get downloaded when they execute npm install.

Which two reasons could be possible explanations for this?

Choose 2 answers

A.
The developer missed the option --add when adding the dependency.
A.
The developer missed the option --add when adding the dependency.
Answers
B.
The developer added the dependency as a dev dependency, andNODE_ENVIs set to production.
B.
The developer added the dependency as a dev dependency, andNODE_ENVIs set to production.
Answers
C.
The developer missed the option --save when adding the dependency.
C.
The developer missed the option --save when adding the dependency.
Answers
D.
D.
Answers
Suggested answer: B, C, D

Explanation:

Choose 2 answers

A. The developer missed the option --add when adding the dependency.

B. The developer added the dependency as a dev dependency, and

NODE_ENV

Is set to production.

C. The developer missed the option --save when adding the dependency.

D. The developer added the dependency as a dev dependency, and

NODE_ENV is set to production.

Answer: BCD

Explanation:

A developer is asked to fix some bugs reported by users. To do that, the developer adds a breakpoint for debugging.

Function Car (maxSpeed, color){

This.maxspeed =masSpeed;

This.color = color;

Let carSpeed = document.getElementById(' CarSpeed');

Debugger;

Let fourWheels =new Car (carSpeed.value, 'red');

When the code execution stops at the breakpoint on line 06, which two types of information are available in the browser console ?

Choose 2 answers:

A.
The values of the carSpeed and fourWheels variables
A.
The values of the carSpeed and fourWheels variables
Answers
B.
A variable displaying the number of instances created for the Car Object.
B.
A variable displaying the number of instances created for the Car Object.
Answers
C.
The style, event listeners and other attributes applied to the carSpeed DOM element
C.
The style, event listeners and other attributes applied to the carSpeed DOM element
Answers
D.
The information stored in the window.localStorage property
D.
The information stored in the window.localStorage property
Answers
Suggested answer: C, D

At Universal Containers, every team has its own way of copying JavaScript objects. The code Snippet shows an implementation from one team:

Function Person() { this.firstName = "John"; this.lastName = 'Doe'; This.name =() => ( console.log('Hello $(this.firstName) $(this.firstName)'); )} Const john = new Person (); Const dan = JSON.parse(JSON.stringify(john)); dan.firstName

='Dan'; dan.name(); What is the Output of the code execution?

A.
Hello Dan Doe
A.
Hello Dan Doe
Answers
B.
Hello John DOe
B.
Hello John DOe
Answers
C.
TypeError: dan.name is not a function
C.
TypeError: dan.name is not a function
Answers
D.
TypeError: Assignment to constant variable.
D.
TypeError: Assignment to constant variable.
Answers
Suggested answer: C

Refer to the code below:

Let textValue = '1984';

Which code assignment shows a correct way to convert this string to an integer?

A.
let numberValue = Number(textValue);
A.
let numberValue = Number(textValue);
Answers
B.
Let numberValue = (Number)textValue;
B.
Let numberValue = (Number)textValue;
Answers
C.
Let numberValue = textValue.toInteger();
C.
Let numberValue = textValue.toInteger();
Answers
D.
Let numberValue = Integer(textValue);
D.
Let numberValue = Integer(textValue);
Answers
Suggested answer: A

A developer writers the code below to calculate the factorial of a given number.

Function factorial(number) {

Return number + factorial(number -1);

} factorial(3); What is the result of executing line 04?

A.
0
A.
0
Answers
B.
6
B.
6
Answers
C.
-Infinity
C.
-Infinity
Answers
D.
RuntimeError
D.
RuntimeError
Answers
Suggested answer: D

Given the following code:

Let x =null; console.log(typeof x); What is the output of the line 02?

A.
"Null"
A.
"Null"
Answers
B.
"X"
B.
"X"
Answers
C.
"Object"
C.
"Object"
Answers
D.
"undefined"
D.
"undefined"
Answers
Suggested answer: C

Which function should a developer use to repeatedly execute code at a fixed interval ?

A.
setIntervel
A.
setIntervel
Answers
B.
setTimeout
B.
setTimeout
Answers
C.
setPeriod
C.
setPeriod
Answers
D.
setInteria
D.
setInteria
Answers
Suggested answer: A

Refer to the code below:

Function changeValue(obj) {

Obj.value = obj.value/2;

}

Const objA = (value: 10);

Const objB = objA; changeValue(objB); Const result = objA.value; What is the value of result after the code executes?

A.
10
A.
10
Answers
B.
Nan
B.
Nan
Answers
C.
5
C.
5
Answers
D.
Undefined
D.
Undefined
Answers
Suggested answer: C

Given HTML below:

<div>

<div id ="row-uc"> Universal Container</div>

<div id ="row-aa">Applied Shipping</div>

<div id ="row-bt"> Burlington Textiles </div>

</div>

Which statement adds the priority = account CSS class to the universal Containers row ?

A.
Document .querySelector('#row-uc').classes.push('priority-account');
A.
Document .querySelector('#row-uc').classes.push('priority-account');
Answers
B.
Document .queryElementById('row-uc').addclass('priority-account');
B.
Document .queryElementById('row-uc').addclass('priority-account');
Answers
C.
Document .querySelector('#row-uc').classList.add('priority-account');
C.
Document .querySelector('#row-uc').classList.add('priority-account');
Answers
D.
Document .querySelectorALL('#row-uc').classList.add('priority-account');
D.
Document .querySelectorALL('#row-uc').classList.add('priority-account');
Answers
Suggested answer: B

Refer to the code below: const addBy = ? const addByEight =addBy(8); const sum = addBYEight(50); Which two functions can replace line 01 and return 58 to sum?

Choose 2 answers

A.
const addBy = function(num1){ return function(num2){ return num1 + num2;}
A.
const addBy = function(num1){ return function(num2){ return num1 + num2;}
Answers
B.
const addBy = function(num1){ return num1 + num2;}
B.
const addBy = function(num1){ return num1 + num2;}
Answers
C.
const addBy = (num1) => num1 + num2 ;
C.
const addBy = (num1) => num1 + num2 ;
Answers
D.
const addBY = (num1) => (num2) => num1 + num2;
D.
const addBY = (num1) => (num2) => num1 + num2;
Answers
Suggested answer: A, D
Total 224 questions
Go to page: of 23