JavaScript-Developer-I Practice Exam and Study Guides - Verified By ActualPDF Updated 225 Questions [Q92-Q112]

Share

JavaScript-Developer-I Practice Exam and Study Guides - Verified By ActualPDF Updated 225 Questions

2023 Updated Verified Pass JavaScript-Developer-I Study Guides & Best Courses


How to book the Salesforce JavaScript-Developer-I Exam

There are the following steps for registering the Salesforce JavaScript Developer I exam. Step 1: Visit Salesforce Exam Registration Step 2: Signup/Login to Salesforce account Step 4: Select Date, time and confirm with the payment method

 

NEW QUESTION 92
Refer to the code below:

Considering the implementations of 'use strict' on line 04, which three statements describes the executes of the code? Choose 3 answers

  • A. Line 05 throws an error.
  • B. 'use strict' has an effect only on line 05.
  • C. 'use strict' has an effect between line 04 and the end of the file.
  • D. 'use strict , is hoisted, so it has an effect on all lines.
  • E. Z is equal to 3,14.

Answer: A,D,E

 

NEW QUESTION 93
Refer to the code below:

Which replacement for the conditional statement on line 02 allows a developer to correctly determine that a specific element, myElement on the page had been clicked?

  • A. event.target.id =='myElement'

Answer: A

 

NEW QUESTION 94
A developer has a formatName function that takes two arguments, firstName and lastName and returns a string. They want to schedule the
function to run once after five seconds.
What is the correct syntax to schedule this function?

  • A. setTimout(() => { formatName("John', 'Doe') }, 5000);
  • B. setTimeout (formatName(), 5000, "John", "BDoe");
  • C. setTimeout (formatName('John', ''Doe'), 5000);
  • D. setTimeout ('formatName', 5000, 'John", "Doe');

Answer: D

 

NEW QUESTION 95
Refer to the following code:

What is the output of line 11?

  • A. ["foo:1", "bar:2"]
  • B. ["bar", "foo"]
  • C. [1,2]
  • D. ["foo", "bar"]

Answer: D

 

NEW QUESTION 96
Which two console logs outputs NaN ?
Choose 2 answers

  • A. console.log(10/ Number('5'));
  • B. console.log(10/ ''five);
  • C. console.log(parseInt('two'));
  • D. console.log(10/0);

Answer: B,C

 

NEW QUESTION 97
Which three browser specific APIs are available for developer to persist data between page loads?
Choose 3 answers

  • A. IIFEs
  • B. global variables
  • C. localStorage
  • D. cookies
  • E. indexedDB

Answer: A,C,E

 

NEW QUESTION 98
A developer implements a function that adds a few values.
Function sum(num) {
If (num == undefined) {
Num =0;
}
Return function( num2, num3){
If (num3 === undefined) {
Num3 =0 ;
}
Return num + num2 + num3;
}
}
Which three options can the developer invoke for this function to get a return value of 10 ?
Choose 3 answers

  • A. sum() (5, 5)
  • B. Sum () (20)
  • C. sum(5)(5)
  • D. sum(10) ()
  • E. Sum (5, 5) ()

Answer: A,C

 

NEW QUESTION 99
Given the code below:
const copy = JSON.stringify([ new String(' false '), new Bollean( false ), undefined ]); What is the value of copy?

  • A. -- [ \"false\" , { } ]--
  • B. -- [ false, { } ]--
  • C. -- [ \"false\" , false, undefined ]--
  • D. -- [ \"false\" ,false, null ]--

Answer: D

 

NEW QUESTION 100
Refer to the code below:
Const resolveAfterMilliseconds = (ms) => Promise.resolve (
setTimeout (( => console.log(ms), ms ));
Const aPromise = await resolveAfterMilliseconds(500);
Const bPromise = await resolveAfterMilliseconds(500);
Await aPromise, wait bPromise;
What is the result of running line 05?

  • A. aPromise and bPromise run sequentially.
  • B. Only aPromise runs.
  • C. Neither aPromise or bPromise runs.
  • D. aPromise and bPromise run in parallel.

Answer: C

 

NEW QUESTION 101
A developer wants to create an object from a function in the browser using the code below.

What happens due to the lack of the mm keyword on line 02?

  • A. The m variable is assigned the correct object.
  • B. window.name is assigned to 'hello' and the variable = remains undefined.
  • C. The m variable is assigned the correct object but this.name remains undefined.
  • D. window.m Is assigned the correct object.

Answer: B

 

NEW QUESTION 102
Refer to the code below:
Let foodMenu1 = ['pizza', 'burger', 'French fries'];
Let finalMenu = foodMenu1;
finalMenu.push('Garlic bread');
What is the value of foodMenu1 after the code executes?

  • A. [ 'Garlic bread' , 'pizza','Burger', 'French fires' ]
  • B. [ 'pizza','Burger', 'French fires']
  • C. [ 'pizza','Burger', 'French fires', 'Garlic bread']
  • D. [ 'Garlic bread']

Answer: B

 

NEW QUESTION 103
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:
<input type =" text" value="Hello" name ="input">
<button type ="button" >Display </button> 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 to make this code work as expected?

  • A. Replace line 04 with console.log(input .value);
  • B. Replace line 03 with const input = document.getElementByName('input');
  • C. Replace line 02 with button.addCallback("click", function() {
  • D. Replace line 02 with button.addEventListener("onclick", function() {

Answer: A

 

NEW QUESTION 104
A developer at Universal Containers creates a new landing page based on HTML, CSS, and JavaScript TO ensure that visitors have a good experience, a script named personaliseContext needs to be executed when the webpage is fully loaded (HTML content and all related files ), in order to do some custom initialization.
Which statement should be used to call personalizeWebsiteContent based on the above business requirement?

  • A. document.addEventListener(''onDOMContextLoaded', personalizeWebsiteContext);
  • B. Document.addEventListener('''DOMContextLoaded' , personalizeWebsiteContext);
  • C. window.addEventListener('load',personalizeWebsiteContext);
  • D. window.addEventListener('onload', personalizeWebsiteContext);

Answer: C

 

NEW QUESTION 105
A developer has code that calculates a restaurant bill, but generates incorrect answers while testing the code.

Which option allows the developer to step into each function execution within calculateBill?

  • A. Wrapping findsubtotal in a console .log method.
  • B. Using the debugger command on line 03.
  • C. Using the debugger command on line 05.
  • D. Calling the console. Trace( total ) method on line 03.

Answer: B

 

NEW QUESTION 106
A developer is setting up a new Node.js server with a client library that is built using events and callbacks.
The library:
* Will establish a web socket connection and handle receipt of messages to the server
* Will be imported with require, and made available with a variable called we.
The developer also wants to add error logging if a connection fails.
Given this info, which code segment shows the correct way to set up a client with two events that listen at execution time?

  • A. ws.on ('connect', ( ) => {
    console.log('connected to client'); ws.on('error', (error) => { console.log('ERROR' , error); });
    });
  • B. ws.connect (( ) => {
    console.log('connected to client'); }).catch((error) => { console.log('ERROR' , error); }};
  • C. try{
    ws.connect (( ) => {
    console.log('connected to client'); });
    } catch(error) { console.log('ERROR' , error); };
    }
  • D. ws.on ('connect', ( ) => { console.log('connected to client'); }}; ws.on('error', (error) => { console.log('ERROR' , error); }};

Answer: D

 

NEW QUESTION 107
Refer to following code:
class Vehicle {
constructor(plate) {
This.plate =plate;
}
}
Class Truck extends Vehicle {
constructor(plate, weight) {
//Missing code
This.weight = weight;
}
displayWeight() {
console.log('The truck ${this.plate} has a weight of ${this.weight} lb.');}}
Let myTruck = new Truck('123AB', 5000);
myTruck.displayWeight();
Which statement should be added to line 09 for the code to display 'The truck 123AB has a
weight of 5000lb.'?

  • A. Super.plate =plate;
  • B. Vehicle.plate = plate;
  • C. This.plate =plate;
  • D. super(plate);

Answer: D

 

NEW QUESTION 108
Universal Containers (UC) notices that its application that allows users to search for
accounts makes a network request each time a key is pressed. This results in too many
requests for the server to handle.
● Address this problem, UC decides to implement a debounce function on string change
handler.
What are three key steps to implement this debounce function?
Choose 3 answers:

  • A. If there is an existing setTimeout and the search string changes, cancel the existing
    setTimeout using the persisted timerId and replace it with a new setTimeout.
  • B. When the search string changes, enqueue the request within a setTimeout.
  • C. Ensure that the network request has the property debounce set to true.
  • D. Store the timeId of the setTimeout last enqueued by the search string change handle.
  • E. If there is an existing setTimeout and the search string change, allow the existing
    setTimeout to finish, and do not enqueue a new setTimeout.

Answer: B,C,E

 

NEW QUESTION 109
Refer to the code below:

What is the value of result after line 10 executes?

  • A. Error: myFather.job is not a function
  • B. John undefined
  • C. John Developer
  • D. undefined Developer

Answer: C

 

NEW QUESTION 110
bar, awesome is a popular JavaScript module. the versions publish to npm are:

Teams at Universal Containers use this module in a number of projects. A particular project has the package, json definition below.

A developer runs this command: npm install.
Which version of bar .awesome is installed?

  • A. 1.3.1
  • B. The command fails, because version 130 is not found
  • C. 1.3.5
  • D. 1.4.0

Answer: C

 

NEW QUESTION 111
Universal Containers (UC) notices that its application that allows users to search for accounts makes a network request each time a key is pressed. This results in too many requests for the server to handle.
* Address this problem, UC decides to implement a debounce function on string change handler.
What are three key steps to implement this debounce function?
Choose 3 answers:

  • A. When the search string changes, enqueue the request within a setTimeout.
  • B. If there is an existing setTimeout and the search string changes, cancel the existing setTimeout using the persisted timerId and replace it with a new setTimeout.
  • C. Ensure that the network request has the property debounce set to true.
  • D. If there is an existing setTimeout and the search string change, allow the existing setTimeout to finish, and do not enqueue a new setTimeout.
  • E. Store the timeId of the setTimeout last enqueued by the search string change handle.

Answer: A,C,D

 

NEW QUESTION 112
......


For more info read reference:

Salesforce JavaScript-Developer-I Certification leaning site Salesforce JavaScript-Developer-Is Certification resources

 

Ultimate Guide to the JavaScript-Developer-I - Latest Edition Available Now: https://www.actualpdf.com/JavaScript-Developer-I_exam-dumps.html

2023 Updated Verified Pass JavaScript-Developer-I Exam - Real Questions and Answers: https://drive.google.com/open?id=1LMl75fhCd9re5-npOlChrV8jq1rFm_3D