]> git.mdlowis.com Git - projs/mdl.git/commitdiff
thats just, like, my opinion, man
author80B <wtf@idk.lol>
Thu, 7 Jan 2021 22:03:57 +0000 (22:03 +0000)
committer80B <wtf@idk.lol>
Thu, 7 Jan 2021 22:03:57 +0000 (22:03 +0000)
index.html

index a712ed02c15c04834606e8681e99666b3880f1e6..ae1724db0ebbe5c363a307271b084e8ec95b1105 100644 (file)
@@ -67,12 +67,8 @@ const loadPage = file => {
 
     fetch("index.json")
         .then(response => response.json())
-        .then(data => {
-            for (const [key, value] of Object.entries(data)) {
-              pages.appendChild(
-                L('li', {}, L('a', {href: '#', onclick: ()=>loadPage(key)}, value)));
-            }
-        })
+        .then(data => pages.append(...Object.entries(data).map( ([key, value]) =>
+            L('li', {}, L('a', {href: '#', onclick: () => loadPage(key)}, value)) ));
 })();
 </script>