Skip to content

Commit

Permalink
Update script.js Removed the .repeat(2)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxwellLaw authored Sep 13, 2024
1 parent 91e1573 commit 74525aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ async function setupCryptoPriceTicker() {
tickerElement.style.overflowX = 'hidden';
document.body.appendChild(tickerElement);

const currencies = ['BTCUSDT', 'ETHUSDT', 'XRPUSDT', 'LTCUSDT', 'ADAUSDT'];
const currencies = ['BTCUSDT', 'ETHUSDT', 'BNBUSDT', 'SOLUSDT', 'XRPUSDT', 'LTCUSDT', 'DOGEUSDT', 'BOMEUSDT'];
let tickerContent = '';

for (const currency of currencies) {
const price = await fetchPrice(currency);
tickerContent += `${currency.replace('USDT', '')}: $${price} | `;
}

tickerElement.innerHTML = `<div class="ticker-content">${tickerContent.repeat(2)}</div>`;
tickerElement.innerHTML = `<div class="ticker-content">${tickerContent}</div>`;// Removed the tickerContent.repeat(2)

const tickerContentElement = tickerElement.querySelector('.ticker-content');
tickerContentElement.style.display = 'inline-block';
Expand Down

0 comments on commit 74525aa

Please sign in to comment.