REST countries api

Please log in to post a comment
Log in with GitHubCommunity feedback
- @hassaneljebyly
congrats on finishing challenge, It looks good, but search and filter by region is not working. you can use the code below to make searching and filtering work, using the states from select and search input as conditions for filtering, then map over the filtered list and display it.
const filteredCountryList = countries.filter((country) => { if ( // filter by region (selectInput === "" || selectInput === country.region.toLowerCase()) && // filter by name country.name.common.toLowerCase().includes(searchInput.toLowerCase()) ) return country; });
Marked as helpful
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord