ExamGecko
Ask Question

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

Add to Whishlist

List of questions

Question 31

Report Export Collapse

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

The developer missed the option --add when adding the dependency.
The developer missed the option --add when adding the dependency.
The developer added the dependency as a dev dependency, andNODE_ENVIs set to production.
The developer added the dependency as a dev dependency, andNODE_ENVIs set to production.
The developer missed the option --save when adding the dependency.
The developer missed the option --save when adding the dependency.
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:

asked 23/09/2024
Darin Ambrose
43 questions

Question 32

Report Export Collapse

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:

The values of the carSpeed and fourWheels variables
The values of the carSpeed and fourWheels variables
A variable displaying the number of instances created for the Car Object.
A variable displaying the number of instances created for the Car Object.
The style, event listeners and other attributes applied to the carSpeed DOM element
The style, event listeners and other attributes applied to the carSpeed DOM element
The information stored in the window.localStorage property
The information stored in the window.localStorage property
Suggested answer: C, D
asked 23/09/2024
Khalid Hamid
46 questions

Question 33

Report Export Collapse

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?

Hello Dan Doe
Hello Dan Doe
Hello John DOe
Hello John DOe
TypeError: dan.name is not a function
TypeError: dan.name is not a function
TypeError: Assignment to constant variable.
TypeError: Assignment to constant variable.
Suggested answer: C
asked 23/09/2024
Joao Domingues
36 questions

Question 34

Report Export Collapse

Refer to the code below:

Let textValue = '1984';

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

let numberValue = Number(textValue);
let numberValue = Number(textValue);
Let numberValue = (Number)textValue;
Let numberValue = (Number)textValue;
Let numberValue = textValue.toInteger();
Let numberValue = textValue.toInteger();
Let numberValue = Integer(textValue);
Let numberValue = Integer(textValue);
Suggested answer: A
asked 23/09/2024
ALOUAT EKRAM
49 questions

Question 35

Report Export Collapse

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?

0
0
6
6
-Infinity
-Infinity
RuntimeError
RuntimeError
Suggested answer: D
asked 23/09/2024
Tony Hartzell
41 questions

Question 36

Report Export Collapse

Given the following code:

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

"Null"
"Null"
"X"
"X"
"Object"
"Object"
"undefined"
"undefined"
Suggested answer: C
asked 23/09/2024
vceplus plus
50 questions

Question 37

Report Export Collapse

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

setIntervel
setIntervel
setTimeout
setTimeout
setPeriod
setPeriod
setInteria
setInteria
Suggested answer: A
asked 23/09/2024
Ilia Voronkov
46 questions

Question 38

Report Export Collapse

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?

10
10
Nan
Nan
5
5
Undefined
Undefined
Suggested answer: C
asked 23/09/2024
Danilo Romelli
61 questions

Question 39

Report Export Collapse

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 ?

Document .querySelector('#row-uc').classes.push('priority-account');
Document .querySelector('#row-uc').classes.push('priority-account');
Document .queryElementById('row-uc').addclass('priority-account');
Document .queryElementById('row-uc').addclass('priority-account');
Document .querySelector('#row-uc').classList.add('priority-account');
Document .querySelector('#row-uc').classList.add('priority-account');
Document .querySelectorALL('#row-uc').classList.add('priority-account');
Document .querySelectorALL('#row-uc').classList.add('priority-account');
Suggested answer: B
asked 23/09/2024
Ramesh Kumar Patel
41 questions

Question 40

Report Export Collapse

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

const addBy = function(num1){ return function(num2){ return num1 + num2;}
const addBy = function(num1){ return function(num2){ return num1 + num2;}
const addBy = function(num1){ return num1 + num2;}
const addBy = function(num1){ return num1 + num2;}
const addBy = (num1) => num1 + num2 ;
const addBy = (num1) => num1 + num2 ;
const addBY = (num1) => (num2) => num1 + num2;
const addBY = (num1) => (num2) => num1 + num2;
Suggested answer: A, D
asked 23/09/2024
IGNACIO CHICO TORRES
42 questions
Total 224 questions
Go to page: of 23
Search

Related questions