Learn Fetch and Promises by Building an fCC Authors Page - Step 18

Tell us what’s happening:

So my issue is that my code is correct. After I finish my code and submit it, it shows “Sorry, your code does not pass.” What to do !

Your code so far

/* file: script.js */
const authorContainer = document.getElementById('author-container');
const loadMoreBtn = document.getElementById('load-more-btn');

let startingIndex = 0;
let endingIndex = 8;
let authorDataArr = [];

fetch('https://cdn.freecodecamp.org/curriculum/news-author-page/authors.json')
  .then((res) => res.json())
  .then((data) => {
    authorDataArr = data;
    displayAuthors(authorDataArr.slice(startingIndex, endingIndex));   
  })
  .catch((err) => {
    console.error(`There was an error: ${err}`);
  });

const displayAuthors = (authors) => {
  authors.forEach(({ author, image, url, bio }, index) => {
    authorContainer.innerHTML += `
    <div id="${index}" class="user-card">
      <h2 class="author-name">${author}</h2>
      <img class="user-img" src="${image}" alt="${author} avatar" />

// User Editable Region

//HERE IS THE PROBLEM :melting_face:

<p class="bio">${bio}</p>

// User Editable Region

    </div>
  `;
  });
};

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

Challenge Information:

Learn Fetch and Promises by Building an fCC Authors Page - Step 18

1 Like

Hello,
your code is correct, just reset the lesson, close the tab then reopen it and try again, it should work and if it does not try another browser

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.