diff --git a/js/load.js b/js/load.js index a13548e..e2cabe0 100644 --- a/js/load.js +++ b/js/load.js @@ -9,6 +9,10 @@ const loadSection = (sectionName) =>{ .catch(error => console.error('Error loading JSON:', error)); } +function cap(str) { + return str.charAt(0).toUpperCase() + str.slice(1); + } + // Recursive function to handle strings, arrays, and objects const renderItems = (items) => { return items.map(item => { @@ -18,8 +22,8 @@ const renderItems = (items) => { return renderItems(item); // recurse into nested array } else if (typeof item === 'object') { return `
${Object.entries(item).map(([key, value]) =>
- `${value}`).join('
')}
${String(item)}
`; }