[2022] Pass JavaScript-Developer-I Exam - Real Questions & Answers
JavaScript-Developer-I Exam Questions Get Updated [2022] with Correct Answers
NEW QUESTION 86
A class was written to represent items for purchase in an online store, and a second class representing items that are on sale at a discounted price. The constructor sets the name to the first value passed in. The pseudocode is below:
There is a new requirement for a developer to implement a description method that will retrun a brief description for item and saleitem.
What is the out when executing the code above?
- A. This is a Scarf
This is a Shirt
This is a discounted Scard
This is a discounted Shirt - B. This is a Scarf
This is a Shirt
This is a Scarf
This is a discounted Shirt - C. This is a Scarf
Unicaught TypeError: saleitem, description is not a function
This is a Scarf
This is a discounted Shirt - D. This is a Scaf
Uncaught TypeError: saleItem, description is not a function
This is a Shirt
This is a discounted Shirt
Answer: B
NEW QUESTION 87
Universal Container (UC) notices that its application allows users to search for account makes a network request each time a key is pressed. This results in too many request for the server to handle.
O address this problem, UC decides to implement a deboune function on the search string change handler. Choose 3 answers
- A. If the there is an existing setTimeout and the search string changes, cancel the existing setTimeout using the persisted timeout replace it with a new setTimeout.
- B. If there is an existing settimeout and the search string changes, allow the existing setTimeout to finish, and do not enqueue a settimeout.
- C. When the search string changes, enqueue the request within a setTimeout.
- D. Ensure that the network request has the property debounce set to true,
- E. Store the timeId of the setTimeout last enqueued by the search string change handler.
Answer: A,C,D
NEW QUESTION 88
Given the code below.
What is logged to the console?
- A. 0
- B. 1
- C. 2
- D. 3
Answer: B
NEW QUESTION 89
Which three browser specific APIs are available for developer to persist data between page loads?
Choose 3 answers
- A. cookies
- B. indexedDB
- C. global variables
- D. localStorage
- E. IIFEs
Answer: B,D,E
NEW QUESTION 90
A developer has the following array of student test grades:
Let arr - [7, 8, 5, 9]
How should want to double each score and then see an array of the students who scored more than 15 points.
How should the developer implement the request?
- A. Let arr1 = arr.map ((num) => num + 2 .filter ((val) => val 15 );
- B. Let arr1 = arr .filter ((filter ((val) => ( return val > 15 )) .map (( num => ( return num +2 ));
- C. Let arr1 = arr .map ((num => ( num + 2 )) .filterBy ((val => ( val 15 )) ;
- D. Let arr1 = arr.mapBy ((num) => return num + 2 )) .filterBy ((val) => ( return val > 15 )) ;
Answer: A
NEW QUESTION 91
Refer to the code below:
A developer needs to dispatch a custom event called update to send information about recordId.
Which two options could a developer insert at the placeholder in line 02 to achieve this? Choose 2 answers
- A. {type ; update ', recordId : '123abc')
- B. 'update', {
Detail ; {
recordId, '123abc
)
) - C. 'update', ( recordId ; 123abc'
) - D. 'update' , '123abc'
Answer: B,C
NEW QUESTION 92
Refer to the following code:
What is returned by the function call on line 13?
- A. Line 13 throws an error.
- B. Undefined value.
- C. Undefined
- D. Null value
Answer: A
NEW QUESTION 93
Which statement accurately describes the behavior of the async /swait keywords?
- A. The associated function sometimes returns a promise.
- B. The associated function can only be called via asynchronous methods.
- C. The associated class contains some asynchronous functions.
- D. The associated function will always return a promise.
Answer: D
NEW QUESTION 94
In the browser, the window object is often used to assign variables that require the broadcast scope in an application Node is application do not have access to the window object by default.
Which two methods are used to address this? Choose 2 answer
- A. Assign variables to the global object.
- B. Create a new window object in the root file.
- C. Assign variables to module, exports and require them as needed.
- D. Use the document instead of the window object.
Answer: B,D
NEW QUESTION 95
A developer at Universal Container creates a new landing page based on HTML, CSS, and JavaScript.
To ensure that visitors have a good experience, a script named personalizeewebsiteCotent 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 ('DCMContentLoaded' , personalizeWebsiteContent);
- B. Window, addEventListener('load', personalizewebsiteContent);
- C. Document, addEventListener ('oDCMContentLoaded' , personalizewensiteContent);
- D. Window, addEventListener('onload', personalizewebsiteContent);
Answer: B
NEW QUESTION 96
Which statement accurately describes an aspect of promises?
- A. In a , them ( ) function, returning results is not necessary since callback will catch the result of a previous promise.
- B. Agruments for the callback function passed to .then ( ) are optional.
- C. .Them ( ) cannot be added after a catch.
- D. .then ( ) manipulates and returns the original promise.
Answer: B
NEW QUESTION 97
Refer to the code below:
Const searchTest = 'Yay! Salesforce is amazing!" ;
Let result1 = searchText.search(/sales/i);
Let result 21 = searchText.search(/sales/i);
console.log(result1);
console.log(result2);
After running this code, which result is displayed on the console?
- A. > 5 > -1
- B. > 5 >undefined
- C. > 5 > 0
- D. > true > false
Answer: B
NEW QUESTION 98
Given the requirement to refactor the code above to JavaScript class format, which class definition is correct?
- A.

- B.

- C.

- D.

Answer: A
NEW QUESTION 99
Refer to the HTML below:
<p> The current status of an order: < span> id='' status '> In progress < /span> < /p> Which JavaScript Statement changes the text 'In Progress' to Completed'?
- A. Document, getElementById ('',status''), innerHTML = 'Completed' ;
- B. Document, getElementById (''status''), innerHTML = 'Completed' ;
- C. Document, getElementById (''# status''), innerHTML = 'Completed' ;
- D. Document, getElementById (status'') , value = completed' ;
Answer: B
NEW QUESTION 100
A developer wrote the following code to test a sum3 function that takes in an array of numbers and returns the sum of the first three numbers in the array, and the test passes.
A different developer made changes to the behavior of sum3 to instead sum only the first two numbers present in the array.
Which two results occur when running this test on the updated sum3 function?
Choose 2 answers
- A. The line 02 assertion fails.
- B. The line 05 assertion fails.
- C. The line 02 assertion passes.
- D. The line 05 assertion passes.
Answer: B,C
NEW QUESTION 101
A developer is working on an ecommerce website where the delivery date is dynamically calculated based on the current dat. The code line below is responsible for this calculation.
Const deliveryDate = new Date ( );
Due to changes in the business requirements, the delivery date must now be today's date + 9 days.
Which code meets this new requirements?
- A. deliveryDate. setDate (( new Date ()) .getDate () + 9);
- B. deliveryDate. setDate ( Date . current () + 9 0;
- C. deliveryDate. Date = new Date (+9) ;
- D. deliveryDate . date = date . current () + 9
Answer: A
NEW QUESTION 102
Refer to the code below:
Const pi w 3.1415926;
What is the data type of pi?
- A. Double
- B. Float
- C. Decimal
- D. Number
Answer: D
NEW QUESTION 103
Refer to the code below:
A developer import a library that creates a web server. the imported library uses events and callback to start the server.
Which code should be inserted at line 03 to set up an event and start the web server?
- A. server ( (port) => (
Console.log ('Listening on' , port) ;
}}; - B. Server .start();
- C. Server. on ('connet' , (port) => (
Console.log (Listening on' port);
}}; - D. server( );
Answer: A
NEW QUESTION 104
......
Practice JavaScript-Developer-I Questions With Certification guide Q&A from Training Expert BraindumpsIT: https://www.braindumpsit.com/JavaScript-Developer-I_real-exam.html
Free Salesforce JavaScript-Developer-I Test Practice Test Questions Exam Dumps: https://drive.google.com/open?id=1h54nIjCL110_kPPnZkscb3p0bxIIk8D4