ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 104 - Certified JavaScript Developer I discussion

Report
Export

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 change, allow the existing setTimeout to finish, and do not enqueue a new setTimeout.
Answers
A.
If there is an existing setTimeout and the search string change, allow the existing setTimeout to finish, and do not enqueue a new setTimeout.
B.
When the search string changes, enqueue the request within a setTimeout.
Answers
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.
Answers
C.
Ensure that the network request has the property debounce set to true.
D.
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.
Answers
D.
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.
E.
Store the timeId of the setTimeout last enqueued by the search string change handle.
Answers
E.
Store the timeId of the setTimeout last enqueued by the search string change handle.
Suggested answer: A, B, C
asked 23/09/2024
karl hickey
42 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first