From: 80B Date: Thu, 7 Jan 2021 22:10:40 +0000 (+0000) Subject: pages.children is an HTMLCollection (does not have forEach or map) X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=b28ae5d8933265f97b2b5854f47cac236f2a80c9;p=projs%2Fmdl.git pages.children is an HTMLCollection (does not have forEach or map) [...pages.children] converts it to an array (does have forEach and map) --- 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();