I am rendering HTML with Javascript and Contentful.
My code:
contentfulClient.getEntries({
content_type: PRODUCT_CONTENT_TYPE_ID,
order: '-fields.dateRated'
})
.then(function(entries) {
container.innerHTML = renderProducts(entries.items)
})
function renderProducts(products) {
return '<table id="film-table"><tr><th>Name</th><th>Rating</th></tr><tr><td>Check back tomorrow</td><td class="rating-cell"></td></tr>' +
products.map(renderSingleProduct) +
'</table>'
}
However, when I test this a comma appears above the table for each entry: commas above table.
Thanks for the help.