ExamGecko
Ask Question

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

Add to Whishlist

List of questions

Question 71

Report Export Collapse

Refer to the code below:

Salesforce Certified JavaScript Developer I image Question 71 63742 09232024002545000000

Line 05 causes an error.

What are the values of greeting and salutation once code completes?

Greeting is Hello and salutation is Hello, Hello.
Greeting is Hello and salutation is Hello, Hello.
Greeting is Goodbye and salutation is Hello, Hello.
Greeting is Goodbye and salutation is Hello, Hello.
Greeting is Goodbye and salutation is I say Hello.
Greeting is Goodbye and salutation is I say Hello.
Greeting is Hello and salutation is I say hello.
Greeting is Hello and salutation is I say hello.
Suggested answer: A
asked 23/09/2024
Jevgenij Γ…Β½arikov
43 questions

Question 72

Report Export Collapse

Refer to the code below:

Let str = 'javascript';

Str[0] = 'J';

Str[4] = 'S';

After changing the string index values, the value of str is 'javascript'. What is the reason for this value:

Non-primitive values are mutable.
Non-primitive values are mutable.
Non-primitive values are immutable.
Non-primitive values are immutable.
Primitive values are mutable.
Primitive values are mutable.
Primitive values are immutable.
Primitive values are immutable.
Suggested answer: D
asked 23/09/2024
Babak Sadeghpour
33 questions

Question 73

Report Export Collapse

Refer to the code below:

new Promise((resolve, reject) => {

const fraction = Math.random();

if( fraction >0.5) reject("fraction > 0.5, " + fraction);

resolve(fraction);

})

.then(() =>console.log("resolved"))

.catch((error) => console.error(error))

.finally(() => console.log(" when am I called?"));

Salesforce Certified JavaScript Developer I image Question 73 63744 09232024002545000000

When does Promise.finally on line 08 get called?

When rejected
When rejected
When resolved and settled
When resolved and settled
When resolved
When resolved
When resolved or rejected
When resolved or rejected
Suggested answer: D
asked 23/09/2024
Garvey Butler
50 questions

Question 74

Report Export Collapse

Refer to the following array:

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

Salesforce Certified JavaScript Developer I image Question 74 63745 09232024002545000000

Which two lines of code result in a second array, arr2 being created such that arr2 is not a reference to arr1?

Let arr2 = arr1.slice(0, 5);
Let arr2 = arr1.slice(0, 5);
Let arr2 = Array.from(arr1);
Let arr2 = Array.from(arr1);
Let arr2 = arr1;
Let arr2 = arr1;
Let arr2 = arr1.sort();
Let arr2 = arr1.sort();
Suggested answer: A, B
asked 23/09/2024
Zafor Iqbal
39 questions

Question 75

Report Export Collapse

Refer to code below:

Function muFunction(reassign){ Let x = 1; var y = 1; if( reassign ) { Let x= 2; Var y = 2; console.log(x); console.log(y);} console.log(x); console.log(y);} What is displayed when myFunction(true) is called?

2 2 1 1
2 2 1 1
2 2 undefined undefined
2 2 undefined undefined
2 2 1 2
2 2 1 2
2 2 2 2
2 2 2 2
Suggested answer: C
asked 23/09/2024
André Batista
50 questions

Question 76

Report Export Collapse

A developer wants to create an object from a function in the browser using the code below:

Function Monster() { this.name = 'hello' };

Const z = Monster();

What happens due to lack of the new keyword on line 02?

The z variable is assigned the correct object.
The z variable is assigned the correct object.
The z variable is assigned the correct object but this.name remains undefined.
The z variable is assigned the correct object but this.name remains undefined.
Window.name is assigned to 'hello' and the variable z remains undefined.
Window.name is assigned to 'hello' and the variable z remains undefined.
Window.m is assigned the correct object.
Window.m is assigned the correct object.
Suggested answer: C
asked 23/09/2024
Andre van Mierlo
46 questions

Question 77

Report Export Collapse

developer removes the HTML class attribute from the checkout button, so now it is simply:

<button>Checkout</button>.

There is a test to verify the existence of the checkout button, however it looks for a button with class= "blue". The test fails because no such button is found.

Which type of test category describes this test?

True positive
True positive
True negative
True negative
False positive
False positive
False negative
False negative
Suggested answer: D
asked 23/09/2024
Andrea Chichiarelli
46 questions

Question 78

Report Export Collapse

Which two code snippets show working examples of a recursive function?

Choose 2 answers

Let countingDown = function(startNumber) {If ( startNumber >0) {console.log(startNumber) ;return countingDown(startNUmber);} else {return startNumber;}};
Let countingDown = function(startNumber) {If ( startNumber >0) {console.log(startNumber) ;return countingDown(startNUmber);} else {return startNumber;}};
Function factorial ( numVar ) {If (numVar < 0) return;If ( numVar === 0 ) return 1;return numVar -1;
Function factorial ( numVar ) {If (numVar < 0) return;If ( numVar === 0 ) return 1;return numVar -1;
Const sumToTen = numVar => {If (numVar < 0)Return;return sumToTen(numVar + 1)};
Const sumToTen = numVar => {If (numVar < 0)Return;return sumToTen(numVar + 1)};
Const factorial =numVar => {If (numVar < 0) return;If ( numVar === 0 ) return 1;return numVar * factorial ( numVar - 1 );};
Const factorial =numVar => {If (numVar < 0) return;If ( numVar === 0 ) return 1;return numVar * factorial ( numVar - 1 );};
Suggested answer: A, D
asked 23/09/2024
JUAN LUIS BERMUDEZ MAYORAL
33 questions

Question 79

Report Export Collapse

Refer to the HTML below:

<div id="main">

<ul>

<li>Leo</li>

<li>Tony</li>

<li>Tiger</li>

</ul>

</div>

Which JavaScript statement results in changing " Tony" to "Mr. T."?

document.querySelectorAll('$main ONY').innerHTML = ' Mr. T. ';
document.querySelectorAll('$main ONY').innerHTML = ' Mr. T. ';
document.querySelector('$main li:second-child').innerHTML = ' Mr. T. ';
document.querySelector('$main li:second-child').innerHTML = ' Mr. T. ';
document.querySelector('$main li.Tony').innerHTML = ' Mr. T. ';
document.querySelector('$main li.Tony').innerHTML = ' Mr. T. ';
document.querySelector('$main li:nth-child(2)'),innerHTML = ' Mr. T. ';
document.querySelector('$main li:nth-child(2)'),innerHTML = ' Mr. T. ';
Suggested answer: D
asked 23/09/2024
Renaldo Williams
46 questions

Question 80

Report Export Collapse

Considering type coercion, what does the following expression evaluate to?

True + '13' + NaN

' 113Nan '
' 113Nan '
14
14
' true13 '
' true13 '
' true13NaN '
' true13NaN '
Suggested answer: D
asked 23/09/2024
disserto management gmbh
46 questions
Total 224 questions
Go to page: of 23
Search

Related questions