Junior — Senior
Debounced function call
livecode
Task condition
Text search that simulates backend operation. We respond to each entered letter, but the server request (fetchData function) should only be sent after a pause in input of at least 1 second.
- Do not use third-party libraries, everything should be implemented in plain JavaScript.
- Creating an HTML form is not required, just handle the conditional call onChange(value).
- Do not use React or related environments.
// example signature of the function to be called after the pause
function fetchData(query) {
// simulate API call
console.log('API request with parameter:', query);
}