Complete the code to import the debounce function from lodash.
import { [1] } from 'lodash-es';
The debounce function is imported from lodash-es to delay the watcher callback.
Complete the code to create a reactive variable named 'searchTerm'.
const searchTerm = [1]('');
Use ref to create a reactive primitive value like a string.
Fix the error in the watcher setup by completing the debounce call.
watch(searchTerm, debounce(() => {
console.log('Search:', searchTerm.value);
}, [1]));The debounce delay must be a number (milliseconds), not a string or null.
Fill both blanks to create a debounced watcher that triggers on 'inputValue' changes with a 500ms delay.
watch([1], debounce(() => { console.log('Input changed:', [2].value); }, 500));
The watcher listens to inputValue, and inside the callback we access inputValue.value to get the current value.
Fill all three blanks to create a debounced watcher that watches 'query', logs its uppercase value, and uses a 300ms delay.
watch([1], debounce(() => { console.log('Uppercase:', [2].value.[3]()); }, 300));
The watcher watches query. Inside the callback, we access query.value and call toUpperCase() to log the uppercase string.