Summer Special 60% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: bestdeal

Free Salesforce JavaScript-Developer-I Practice Exam with Questions & Answers | Set: 6

Questions 51

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

simply:

.

There is a test to verify the existence of the checkout button, however it looks fora button with

class= “blue”. The test failsbecause no such button is found.

Which type of test category describes this test?

Options:
A.

True positive

B.

True negative

C.

False positive

D.

False negative

Questions 52

Refer to the code below:

for(let number =2 ; number <= 5 ; number += 1 ) {

// insert code statement here

}

Thedeveloper needs to insert a code statement in the location shown. The code

statement has these requirements:

1. Does require an import

2. Logs an error when the boolean statement evaluates to false

3. Works in both the browser and Node.js

Which meet the requirements?

Options:
A.

assert (number % 2 === 0);

B.

console.error(number % 2 === 0);

C.

console.debug(number % 2 === 0);

D.

console.assert(number % 2 === 0);

Questions 53

Refer to the following code:

LetsampleText = ‘The quick brown fox jumps’;

A developer needs to determine if a certainsubstring is part of a string.

Which three expressions return true for the given substring ?

Choose 3 answers

Options:
A.

sampleText.includes(‘fox’);

B.

sampleText.includes(‘ quick’, 4);

C.

sampleText.includes(‘ Fox ’, 3)

D.

sampleText.includes(‘ fox ’);

E.

sampleText.includes(‘ quick ’) !== -1;

Questions 54

A developer is working onan ecommerce website where the delivery date is dynamically

calculated based on the current day. The code line below is responsible for this calculation.

Const deliveryDate = new Date ();

Due to changes in the business requirements, the delivery date mustnow be today’s

date + 9 days.

Which code meets thisnew requirement?

Options:
A.

deliveryDate.setDate(( new Date ( )).getDate () +9);

B.

deliveryDate.setDate( Date.current () + 9);

C.

deliveryDate.date = new Date(+9) ;

D.

deliveryDate.date = Date.current () + 9;

Questions 55

Given the following code:

document.body.addEventListener(‘ click ’, (event) => {

if (/* CODE REPLACEMENT HERE */) {

console.log(‘button clicked!’);

)

});

Which replacement for the conditional statement on line 02 allows a developer to

correctly determine that a button on page is clicked?

Options:
A.

Event.clicked

B.

e.nodeTarget ==this

C.

event.target.nodeName == ‘BUTTON’

D.

button.addEventListener(‘click’)

Questions 56

A team that works on a bigproject 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

Options:
A.

The developer missed the option --addwhen adding the dependency.

B.

The developer added the dependency as a dev dependency, andNODE_ENVIs set to production.

C.

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

D.

The developer added the dependency as a dev dependency, andNODE_ENV is set to production.

Questions 57

Refer to the code below:

JavaScript-Developer-I Question 57

What is the output of this function when called with an emptyarray?

Options:
A.

Return 0

B.

Return 5

C.

Return NaN

D.

Return Infinity

Questions 58

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?

A)

JavaScript-Developer-I Question 58

B)

JavaScript-Developer-I Question 58

C)

JavaScript-Developer-I Question 58

D)

JavaScript-Developer-I Question 58

Options:
A.

Option

B.

Option

C.

Option

D.

Option

Questions 59

Which option istrue about the strict mode in imported modules?

Options:
A.

Add the statement use non-strict, before any other statements in the module to enablenot-strict mode.

B.

You can only reference notStrict() functions from the imported module.

C.

Imported modules are in strict mode whether you declare them as such or not.

D.

Add the statement use strict =false; before any other statements in the module to enablenot- strict mode.

Questions 60

Given the code below:

Setcurrent URL ();

console.log(‘The current URL is: ‘ +url );

functionsetCurrentUrl() {

Url = window.location.href:

What happens when the code executes?

Options:
A.

The url variable has local scope and line 02throws an error.

B.

The url variable has global scope and line 02 executes correctly.

C.

The url variable has global scope and line 02 throws an error.

D.

The url variable has local scope and line 02 executes correctly.