Hey there, I'm currently trying to create output like so:
output.push({ h1: "Collection" })
categories.forEach(cat => {
output.push({ h2: cat.name })
cat.files.forEach(file => {
output.push({ ul: [ {link: { title: file.name, source: file.path }}]})
})
})
Now, that is obviously adding a ul around every link, how would I .push the opening of an ul separate from the ending so I can keep my loop?
Hey there, I'm currently trying to create output like so:
Now, that is obviously adding a ul around every link, how would I .push the opening of an ul separate from the ending so I can keep my loop?