From: Jacob Casper Date: Sun, 19 Apr 2020 01:13:32 +0000 (-0500) Subject: Use more widely supported forEach style X-Git-Url: https://git.jacobcasper.com/?p=brackets.git;a=commitdiff_plain;h=6861bd5ac7116796aedbd2d22fd7d36d98a9866a Use more widely supported forEach style --- 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";