Pass the Salesforce Salesforce Developer JavaScript-Developer-I Questions and answers with CertsForce

Viewing page 2 out of 7 pages
Viewing questions 11-20 out of questions
Questions # 11:

Refer to the following code:

Let sampleText = ‘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;


Expert Solution
Questions # 12:

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)

Question # 12

B)

Question # 12

C)

Question # 12

D)

Question # 12

Options:

A.

Option


B.

Option


C.

Option


D.

Option


Expert Solution
Questions # 13:

Refer to the code below:

const car = {

price:100,

getPrice:function(){

return this.price;

}

};

const customCar = Object.create(car);

customCar.price = 70;

delete customCar.price;const result = customCar.getPrice();

Whatis the value of result after the code executes?

Options:

A.

100


B.

undefined


C.

null


D.

70


Expert Solution
Questions # 14:

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

True + ‘13’ + NaN

Options:

A.

‘ 113Nan ’


B.

14


C.

‘ true13 ’


D.

‘ true13NaN ’


Expert Solution
Questions # 15:

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 fails because 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


Expert Solution
Questions # 16:

Which statement can a developer apply to increment the browser's navigation history without a page refresh?

Which statement can a developer apply to increment the browser's navigation history without a page refresh?

Options:

A.

window.history.pushState(newStateObject);


B.

window.history.pushStare(newStateObject, ' ', null);


C.

window.history.replaceState(newStateObject,'', null);


D.

window.history.state.push(newStateObject);


Expert Solution
Questions # 17:

Refer to the code below:

01 const exec = (item, delay) =>{

02 newPromise(resolve => setTimeout( () => resolve(item), delay)),

03 async function runParallel() {

04 Const (result1, result2, result3) = await Promise.all{

05 [exec (‘x’, ‘100’) , exec(‘y’, 500), exec(‘z’, ‘100’)]

06 );

07 return `parallel is done: $(result1)$(result2)$(result3)`;

08 }

}

}

Which two statements correctly execute the runParallel () function?

Choose 2 answers

Options:

A.

Async runParallel () .then(data);


B.

runParallel ( ). done(function(data){return data;});


C.

runParallel () .then(data);


D.

runParallel () .then(function(data)return data


Expert Solution
Questions # 18:

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 02 throws 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.


Expert Solution
Questions # 19:

Refer to the code below

let inArray = [[1,2],[3,4,5]];

which two statements results in the array [1,2,3,4,5]?

choose 2 answer

Options:

A.

[ ].concat(...inArray);


B.

[ ].concat.apply(inArray,[ ]);


C.

[ ].concat([...inArray])


D.

[ ].concat.apply([ ],inArray);


Expert Solution
Questions # 20:

Given the HTML below:

Question # 20

Which statement adds the priority-account css class to the Applied Shipping row?

Options:

A.

document.querySelector('#row-as').classList.add('priority-account');


Expert Solution
Viewing page 2 out of 7 pages
Viewing questions 11-20 out of questions