Intermediate
A debounced filter
Typing in #q should filter the fruit list: items that don't contain the typed text (ignoring capitals) are hidden with the hidden property; an empty box shows every item.
Debounce it: the filtering must happen 300 ms after the user stops typing, not on every key. Write a debounce(fn, delay) function and use it.
What Check tests
- After a pause, only matching items are shown
- Capitals don't matter
- It waits: nothing changes straight after typing
- Fast typing filters once, for the final text
- An empty box shows every item again
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.