From b28ae5d8933265f97b2b5854f47cac236f2a80c9 Mon Sep 17 00:00:00 2001 From: 80B Date: Thu, 7 Jan 2021 22:10:40 +0000 Subject: [PATCH] pages.children is an HTMLCollection (does not have forEach or map) [...pages.children] converts it to an array (does have forEach and map) --- index.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.html b/index.html index 88f0e9a..ff4bdc2 100644 --- a/index.html +++ b/index.html @@ -33,8 +33,7 @@ const loadPage = file => { const filterPages = (allitems) => { const value = search.value.toLowerCase(); - for (var i = 0; i < pages.children.length; i++) { - const child = pages.children[i]; + [...pages.children].forEach(child => { if (child.style.display !== "none" || allitems) { if (!child.text) { child.text = child.innerText.toLowerCase(); -- 2.52.0