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

Viewing page 7 out of 7 pages
Viewing questions 61-70 out of questions
Questions # 61:

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’)


Expert Solution
Questions # 62:

Given the following code:

Question # 62

is the output of line 02?

Options:

A.

''x''


B.

''null'''


C.

''object''


D.

''undefined''


Expert Solution
Questions # 63:

Refer to the following object:

const cat ={

firstName: ‘Fancy’,

lastName: ‘ Whiskers’,

Get fullName() {

return this.firstName + ‘ ‘ + this.lastName;

}

};

How can a developer access the fullName property for cat?

Options:

A.

cat.fullName


B.

cat.fullName()


C.

cat.get.fullName


D.

cat.function.fullName()


Expert Solution
Questions # 64:

A developer has the function, shown below, that is called when a page loads.

function onload() {

console.log(“Page has loaded!”);

}

Where can the developer see the log statement after loading the page in the browser?

Options:

A.

Terminal running the web server.


B.

Browser performance toots


C.

Browser javaScript console


D.

On the webpage.


Expert Solution
Questions # 65:

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

Question # 65

What is the behavior?

Options:

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.


Expert Solution
Viewing page 7 out of 7 pages
Viewing questions 61-70 out of questions