I wanted to loop through the sections object and print out the key in h1
and the value in p
tag. I'm fine with enclosing this in an array.
<script>
const sections =
{"Title 1": "paragraph",
"Title 2": "paragraph",
"Title 3": "paragraph",
"Title 4": "paragraph",
"Title 5": "paragraph"}
</script>
{#each sections as section}
<h1>{title}</h1>
<p>{paragraph}</p>
{/each}