Solution Review: Avoiding Duplicates

Learn to avoid showing duplicated search.

We'll cover the following

Solution:

The source of the five rendered buttons is the getLastSearches function. There, we take the array of urls and return the last five entries from it. Now we’ll change this utility function to return the last six entries instead of five, removing the last one. Afterward, only the five previous searches are displayed as buttons.

Get hands-on with 1200+ tech skills courses.