In the following example I am trying to render a list of posts (title, body and their tags):
const container = $('.container');
posts.forEach((post)=> {
container.append(
`<div>
<h2>${post.title}</h2>
<p>${post.body}</p>
<div>
${post.tags.map((tag) => {
`<span>${tag.name}</span>`
})}
</div>
</div>`)
});
The output however renders an extra comma between tags. I have tried to to outputting 'test' instead of the actual tag names as well as swapping the span tag for a different html tag, but the result is still the same.
I have tried to search for this issue, but haven't had any luck finding anyone else having this issue with template literals.