format js
All checks were successful
PDX Pecularities Server / deploy (push) Successful in 2s

This commit is contained in:
david 2025-04-07 23:31:33 -07:00
parent f39b8439c0
commit 8d41998929

View File

@ -1,5 +1,5 @@
const loadSection = (sectionName) =>{ const loadSection = (sectionName) => {
fetch(`data/${sectionName}.json`) fetch(`data/${sectionName}.json`)
.then(response => response.json()) .then(response => response.json())
.then(data => { .then(data => {
@ -11,7 +11,7 @@ const loadSection = (sectionName) =>{
function cap(str) { function cap(str) {
return str.charAt(0).toUpperCase() + str.slice(1); return str.charAt(0).toUpperCase() + str.slice(1);
} }
// Recursive function to handle strings, arrays, and objects // Recursive function to handle strings, arrays, and objects
const renderItems = (items) => { const renderItems = (items) => {
@ -28,11 +28,11 @@ const renderItems = (items) => {
return `<p>${String(item)}</p>`; return `<p>${String(item)}</p>`;
} }
}).join(''); }).join('');
}; };
const sections = document.getElementsByClassName('section') const sections = document.getElementsByClassName('section')
Array.from(sections).forEach(section =>{ Array.from(sections).forEach(section => {
loadSection(section.id) loadSection(section.id)
}) })