Print a table of the top 20 coins/tokens exercise

Your assignment now is to write a website, where you print a table of the top 20 coins/tokens from Coinpaprika at the time of loading the website.

Use CodePen or CodeSandbox, and post your solutions here in the forum.

As a reminder, we used this code:

    .then( response => response.json() )
    .then( coins => {
        for (let i = 0; i < 5; ++i ) {
            const coin = coins[i];
            console.log(, coin.symbol );   
    } );
TOP 30 COINS ->>>
<h1>Coin Exchange</h1>


const node = document.querySelector(".coins");
let data =[];

.then(response => response.json())
.then(coins => {
for(let i= 0; i < 30; i++) {
const coin = coins[i];
data.push(<li>${}: ${coin.symbol}</li>)
node.innerHTML = <ol>${data.join('')}</ol>;

Here is a quickie implementation since we’ll be doing something much better in coming lessons:

(@andersbraath1 version is certainly prettier)

1 Like

First time i use codepen, my css within the box don’t render as expected and i should have integrated the coinpaprika svg in the html file.

Unless you register, you are not in control of when codepen re-renders your code. If you have trouble, use instead.

Yes, thanks. I understand now.
I’m currently trying to implement some extras for the last exercise. You made me more than appreciate react. :smiley:

1 Like

React has a future and if you check crypto services compared to banks, you see the trend. Also, given crypto is only recently becoming mainstream, we don’t have to deal with legacy code (jQuery, backbone.js, even older Angular version), which leads to better developer experience.

Fun exercise

1 Like

Great more of this exercises!!! :wink:

1 Like

The solution is correct. I’d suggest checking an automatic code formatter such as ESLint to make your JavaScript code more readable.

1 Like

Just generate everything. Sorry, but I’m addicted to version control, even for the little stuff.


Great stuff. here, you have a not too meaningful comment, pay attention to these once you do repos you want to be proud of and share with potential employers / clients.

For items like this, they are under hack time, and it’s cool to out as many projects as you want, as you document your journey with it and others see you’re enthusiastic. This may win you opportunities.


1 Like

Absolutely having great fun with this!!!

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Top 20 Coins</title>

    body {
      text-align: center;

    th {
      border: 2px solid black;
      height: 25px;

    table {
      width: 100%;

    <h1>Top 20 Coins</h1>

        <tbody id="coinList"></tbody>

    <script src=""></script>

      $(document).ready(function () {
        const BASE_URL = "";
          .then((response) => response.json())
          .then((coins) => {
            for (let i = 0; i < 20; ++i) {
              let coin = coins[i];
              let coinList = $("#coinList");


Some notes: I understand pasting code is easier in one go. On GitHub, avoid inline CSS.

If you’re using jQuery, you can also use $.get(BASE_URL).done(callback); You can save the response => response.json() step with it.

1 Like

See the Pen BazgBvW by Ciaran Wilson (@scrummaciousd) on CodePen.

1 Like