From 6861bd5ac7116796aedbd2d22fd7d36d98a9866a Mon Sep 17 00:00:00 2001 From: Jacob Casper Date: Sat, 18 Apr 2020 20:13:32 -0500 Subject: [PATCH] Use more widely supported forEach style --- frontend/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/index.js b/frontend/index.js index bd10105..c46676d 100644 --- a/frontend/index.js +++ b/frontend/index.js @@ -133,9 +133,7 @@ window.onload = () => { genreInput.addEventListener("input", (e) => { const input = e.target; - for (const item of genreList.children) { - item.style.display = item.dataset.name.includes(input.value.toLowerCase()) ? "block" : "none"; - } + Array.from(genreList.children).forEach((item) => item.style.display= item.dataset.name.includes(input.value.toLowerCase()) ? "block" : "none"); }); genreInput.addEventListener("focus", (e) => { genreList.style.display = "block"; -- 2.20.1