scrimba
JS Deep Dive
Hacker News
Hacker News - Formatting Comments
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Hacker News - Formatting Comments
AboutCommentsNotes
Hacker News - Formatting Comments
Expand for more info
components
Story.js
run
preview
console
export default function Story(story) {
return `
<div class="story">
<div>
<span class="gray">${story.index || ""}</span>
<span class="upvote">▲</span>
<a href="${story.url}">${story.title}</a>
<span>(${story.domain})</span>
</div>
<div>
<div class="gray">
${story.points} points by ${story.user} ${story.time_ago}
|
<a href="#/item?id=${story.id}">
${story.comments_count} comments
</a>
|
<span class="favorite">
<img class="heart" src="https://icon.now.sh/heart/ccc">
Add To Favorites
</span>
</div>
</div>
</div>
`;
}
Console
/index.html
-11:58