Tell us what’s happening:
I understand what they are asking me to do. my question is why is it category_id and why not category.id ?? like we usually use?
why are we using underscore instead of dot notation?
what is this underscore?
if anyone could enlighten me about it . It would be appreciated.
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
const showLatestPosts = (data) => {
const { topic_list, users } = data;
const { topics } = topic_list;
postsContainer.innerHTML = topics.map((item) => {
const {
id,
title,
views,
posts_count,
slug,
posters,
category_id,
bumped_at,
} = item;
return `
<tr>
<td>
<p class="post-title">${title}</p>
// User Editable Region
${forumCategory(category_id)}
// User Editable Region
</td>
<td></td>
<td>${posts_count - 1}</td>
<td>${viewCount(views)}</td>
<td>${timeAgo(bumped_at)}</td>
</tr>`;
}).join("");
};
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Challenge Information:
Learn Asynchronous Programming by Building an fCC Forum Leaderboard - Step 43