Use more widely supported forEach style
authorJacob Casper <dev@jacobcasper.com>
Sun, 19 Apr 2020 01:13:32 +0000 (20:13 -0500)
committerJacob Casper <dev@jacobcasper.com>
Sun, 19 Apr 2020 01:13:32 +0000 (20:13 -0500)
frontend/index.js

index bd10105..c46676d 100644 (file)
@@ -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";