From 96d414edb60404e1d6014a6516c5a09ed1868e0c Mon Sep 17 00:00:00 2001 From: mercyikpe Date: Tue, 7 Feb 2023 02:19:12 +0100 Subject: [PATCH] Update filter code example The current filter code sample for countries that includes 'land' throws a TypeError `country.includes is not a function`. --- .../09_day_higher_order_functions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/09_Day_Higher_order_functions/09_day_higher_order_functions.md b/09_Day_Higher_order_functions/09_day_higher_order_functions.md index 9aa6871..9cdf3ac 100644 --- a/09_Day_Higher_order_functions/09_day_higher_order_functions.md +++ b/09_Day_Higher_order_functions/09_day_higher_order_functions.md @@ -308,12 +308,12 @@ const countriesFirstThreeLetters = countries.map((country) => ### filter -_Filter_: Filter out items which full fill filtering conditions and return a new array. +_Filter_: Filter out items which fullfill filtering conditions and return a new array. ```js //Filter countries containing land const countriesContainingLand = countries.filter((country) => - country.includes('land') + country.name.includes('land') ) console.log(countriesContainingLand) ```