From f233813ecca0f527cd94157329d40a189222f394 Mon Sep 17 00:00:00 2001 From: Abu_Talha_Khalil <162400956+iamabutalha@users.noreply.github.com> Date: Thu, 8 Aug 2024 10:54:03 +0500 Subject: [PATCH] Corrected search functionality to filter products by keywords --- 2-copy-of-code/lesson-18/scripts/amazon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2-copy-of-code/lesson-18/scripts/amazon.js b/2-copy-of-code/lesson-18/scripts/amazon.js index fc8ae97..f03f36a 100644 --- a/2-copy-of-code/lesson-18/scripts/amazon.js +++ b/2-copy-of-code/lesson-18/scripts/amazon.js @@ -19,7 +19,7 @@ function renderProductsGrid() { let matchingKeyword = false; product.keywords.forEach((keyword) => { - if (keyword.toLowerCase().includes(search.toLowerCase())) { + if (search.toLowerCase().includes(keyword.toLowerCase())) { matchingKeyword = true; } });