Challenge: Avoiding Duplicates

Try to avoid showing duplicates searches.

We'll cover the following

Task

  • (1) Do not show the current search as a button, only the five preceding searches.
  • (2) Don’t show duplicated searches. Searching twice for “React” shouldn’t create two different buttons.
  • (3) Set the SearchForm component’s input field value with the last search term if one of the buttons is clicked.

Hints

  • Adapt the getLastSearches function for (1).
  • Adapt the getLastSearches function for (2).

Get hands-on with 1200+ tech skills courses.