JavaScript-Developer-I Salesforce Certified JavaScript Developer I

Loading demo links...

Showing 13–15 of 15 questions

Question 13

Refer to the code below:

What is the result when the Promise in the execute function is rejected?

Select an option, then click Submit answer.

  • Resolved1 Resolved2 Resolved3 Resolved4

  • Rejected

  • Rejected Resolved

  • Rejected1 Rejected2 Rejected3 Rejected Rejected Rejected4

Question 14

A developer writes the code below to return a message to a user attempting to register a new username. If the username is available, a variable named nag is declared and assigned a value on line 03.

What is the value of msg when getAvailableabilityMessage (“newUserName”) is executed and get Availability (“newUserName”) returns true?

Select an option, then click Submit answer.

  • "msg is not defined"

  • "newUserName"

  • "User-name available"

  • undefined

Question 15

A developer creates a simple webpage with an input field. When a user enters text in

the input field and clicks the button, the actual value of the field must be displayed in the

console.

Here is the HTML file content:

The developer wrote the javascript code below:

Const button = document.querySelector(‘button’);

button.addEvenListener(‘click’, () => (

Const input = document.querySelector(‘input’);

console.log(input.getAttribute(‘value’));

When the user clicks the button, the output is always “Hello”.

What needs to be done make this code work as expected?

Select an option, then click Submit answer.

  • Replace line 04 with console.log(input .value);

  • Replace line 03 with const input = document.getElementByName(‘input’);

  • Replace line 02 with button.addEventListener(“onclick”, function() {

  • Replace line 02 with button.addCallback(“click”, function() {