New Year Sale Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: xmas50

Salesforce JavaScript-Developer-I - Salesforce Certified JavaScript Developer (JS-Dev-101)

Page: 5 / 7
Total 219 questions

A developer tries to retrieve all cookies, then sets a certain key value pair in the cookie. These statements are used:

What is the behavior?

A.

Cookies are read, but the key value is not set because the value is not URL encoded.

B.

Cookies are not read because line 01 should be document, cookies, but the key value is set and all cookies are wiped.

C.

A Cookies are read andthe key value is set, the remaining cookies are unaffected.

D.

Cookies are read and the key value is set, and all cookies are wiped.

Refer to following code block:

Let array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,];

Let output =0;

For (let num of array){

if (output >0){

Break;

}

if(num % 2 == 0){

Continue;

}

Output +=num;

What is the value of output after the code executes?

A.

16

B.

36

C.

11

D.

25

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

A.

setIntervel

B.

setTimeout

C.

setPeriod

D.

setInteria

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

True + ‘13’ + NaN

A.

‘ 113Nan ’

B.

14

C.

‘ true13 ’

D.

‘ true13NaN ’

A developer wants to define a function log to be used a few times on a single-file JavaScript script.

01 // Line 1 replacement

02 console.log('"LOG:', logInput);

03 }

Which two options can correctly replaceline 01 and declare the function for use?

Choose 2 answers

A.

function leg(logInput) {

B.

const log(loginInput) {

C.

const log = (logInput) => {

D.

function log = (logInput) {

Given the following code:

What will be the first four numbers logged?

A.

0012

B.

0112

C.

0122

D.

0123

developer publishes a new version of a package with new features that do not break

backward compatibility. The previous version number was 1.1.3.

Following semantic versioning format, what should the new package version number

be?

A.

2.0.0

B.

1.2.3

C.

1.1.4

D.

1.2.0

Refer to the code below:

letsayHello = () => {

console.log (‘Hello, world!’);

};

Which code executes sayHello once, two minutes from now?

A.

setTimeout(sayHello, 12000);

B.

setInterval(sayHello, 12000);

C.

setTimeout(sayHello(), 12000);

D.

delay(sayHello, 12000);

Given the JavaScript below:

01 function filterDOM (searchString) {

02 const parsedSearchString = searchString && searchString.toLowerCase() ;

03 document.quesrySelectorAll(‘ .account’ ) . forEach(account => (

04 const accountName = account.innerHTML.toLOwerCase();

05 account. Style.display = accountName.includes(parsedSearchString) ? /*Insert

code*/;

06 )};

07 }

Which code should replace the placeholder comment on line 05 to hide accounts that do

not match thesearch string?

A.

‘ name ’ : ‘ block ’

B.

‘ Block ’ : ‘ none ’

C.

‘ visible ’ : ‘ hidden ’

D.

‘ hidden ’ : ‘ visible ’

Universal Container(UC) just launched a new landing page, but users complain that the

website is slow. A developer found some functions that cause this problem.To verify this, the

developer decides to do everything and log the time each of these three suspicious functions

consumes.

console.time(‘Performance’);

maybeAHeavyFunction();

thisCouldTakeTooLong();

orMaybeThisOne();

console.endTime(‘Performance’);

Which function can the developer use to obtain the time spent by every one of the three

functions?

A.

console.timeLog()

B.

console.getTime()

C.

console.trace()

D.

console.timeStamp()