4 ms·
A humble suggestion for more readability (warning: opinionated): const reposInfoHTML = repos .map(repo => `<div class="container">
by egeozcan 10y ago
A humble suggestion for more readability (warning: opinionated):
const reposInfoHTML = repos
.map(repo =>
`<div class="container">
<div class="item names">
<div>
<a href="${repo.repoUrl}">${repo.name}</a>
</div>
</div>
<div class="item language">
<div>${repo.language || "Unknown"}</div>
</div>
<div class="item stars">
<div>★${repo.stars}</div>
</div>
</div>`);
$(".repositories").append(reposInfoHTML.join(''));
- NKCSS 10y agoMuch more readable, but I'd advise against using const, because the javascript won't work on IE < 11.